diff options
author | Raghuram Subramani <raghus2247@gmail.com> | 2025-05-10 09:05:48 +0530 |
---|---|---|
committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-05-10 09:05:48 +0530 |
commit | 7e6d28b39ec3f706d86280804011f7436df90851 (patch) | |
tree | 586373b0061c166a0956aec26d4fd257cdf287ce /web/app/job_manager.py | |
parent | 3ed36b1adb0be6a450afb755e192a7198187e052 (diff) |
add webapp
Diffstat (limited to 'web/app/job_manager.py')
-rw-r--r-- | web/app/job_manager.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web/app/job_manager.py b/web/app/job_manager.py new file mode 100644 index 0000000..60c4635 --- /dev/null +++ b/web/app/job_manager.py @@ -0,0 +1,16 @@ +from rq import Queue +from redis import Redis +from jobs.scrape_cases import scrape_cases + +class JobManager: + def __init__(self): + redis = Redis() + self.q = Queue(connection=redis) + + def enqueue_scrape(self, act, section, state_code): + return self.q.enqueue( + scrape_cases, + act, + section, + state_code + ) |