|
|
|
@ -91,7 +91,7 @@ def extract_widgets_from_dict(d, found_ads): |
|
|
|
extract_widgets_from_dict(item, found_ads) |
|
|
|
|
|
|
|
@shared_task |
|
|
|
def run_crawl_pipeline(run_id): |
|
|
|
def run_crawl_pipeline(run_id, force=False): |
|
|
|
""" |
|
|
|
Background Celery task that executes a crawling run. |
|
|
|
Parses Divar listing data, registers new Ads, and queues AI evaluations. |
|
|
|
@ -111,6 +111,7 @@ def run_crawl_pipeline(run_id): |
|
|
|
run.save() |
|
|
|
return |
|
|
|
|
|
|
|
if not force: |
|
|
|
now = timezone.localtime(timezone.now()).time() |
|
|
|
if not (task.start_hour <= now <= task.end_hour): |
|
|
|
run.status = 'SUCCESS' |
|
|
|
|