Update missing kids poster status
This commit is contained in:
@@ -4,18 +4,14 @@ from .src.fetch_feed import FetchFeeds
|
||||
from .src.fetch_parser import FetchParser
|
||||
from .src.db_utils import DB_Handler
|
||||
'''
|
||||
from src.fetch_parser import FetchParser
|
||||
from src.fetch_search import FetchSearcher
|
||||
from src.missing_kids_fetch import MissingKidsFetch
|
||||
from src.missing_kids_status import MissingKidsStatus
|
||||
from src.url_status import UpdateErrorURLs
|
||||
'''
|
||||
|
||||
from .src.logger import get_logger
|
||||
logger = get_logger()
|
||||
|
||||
# TODO: Queues with priorities, process_raw_urls least priority due to slowdown...
|
||||
|
||||
@job
|
||||
def background_task(process_type: str):
|
||||
logger.info("Task triggered: {}".format(process_type))
|
||||
@@ -25,10 +21,16 @@ def background_task(process_type: str):
|
||||
FetchFeeds().run()
|
||||
elif (process_type == "fetch_parser"):
|
||||
FetchParser().run()
|
||||
# TODO: ENCODE BATCH_SIZE IN PROCESS_tYPE..
|
||||
elif (process_type == "process_raw_urls"):
|
||||
DB_Handler().process_raw_urls(batch_size=50)
|
||||
elif (process_type == "process_error_urls"):
|
||||
DB_Handler().process_error_urls(batch_size=50)
|
||||
elif (process_type == "process_missing_kids_urls"):
|
||||
DB_Handler().process_missing_kids_urls(batch_size=50)
|
||||
elif ("process_missing_kids_urls" in process_type):
|
||||
batch_size = int(process_type.split("_")[-1])
|
||||
DB_Handler().process_missing_kids_urls(batch_size=batch_size)
|
||||
else:
|
||||
logger.info("Task unknown!: {}".format(process_type))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user