seawolf2357 commited on
Commit
3355310
·
verified ·
1 Parent(s): e3e5071

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -15
app.py CHANGED
@@ -40,21 +40,8 @@ def fetch_announcements(keyword="", category="전체", region="전체(지역)",
40
  sort_by="등록일순", status_filter="진행중", page=1, rows=20) -> Tuple[pd.DataFrame, str]:
41
  """기업마당 API로 공고 목록 조회 (캐시 우선)"""
42
  try:
43
- # 캐시 용 (필터 없으면 캐시에서 빠르게 로드)
44
- if CACHE_AVAILABLE and category == "전체" and region == "전체(지역)" and not keyword.strip():
45
- items, cache_status = get_cached_announcements()
46
- if items:
47
- status_prefix = f"⚡ {cache_status}"
48
- else:
49
- # 캐시가 비어있으면 API에서 가져오기
50
- items, error = fetch_all_from_api(category, region, keyword)
51
- status_prefix = "🔄 API에서 로드"
52
- if error:
53
- status_prefix = error
54
- else:
55
- # 필터가 있으면 캐시 또는 API에서 가져오기
56
- items, error = fetch_with_cache(category, region, keyword)
57
- status_prefix = error if error else ""
58
 
59
  if not items:
60
  return pd.DataFrame(), f"⚠️ 검색 결과가 없습니다. {status_prefix}"
 
40
  sort_by="등록일순", status_filter="진행중", page=1, rows=20) -> Tuple[pd.DataFrame, str]:
41
  """기업마당 API로 공고 목록 조회 (캐시 우선)"""
42
  try:
43
+ # ⭐ 항상 캐시 우선 사용 (필터 있어도 캐시에서 필터링 - 빠름!)
44
+ items, status_prefix = fetch_with_cache(category, region, keyword)
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  if not items:
47
  return pd.DataFrame(), f"⚠️ 검색 결과가 없습니다. {status_prefix}"