feat: add VedAstro gateway job worker

This commit is contained in:
732642856
2026-07-08 19:21:34 +08:00
parent 92358f2645
commit dcdd30709a
4 changed files with 106 additions and 0 deletions
+12
View File
@@ -953,6 +953,13 @@ class JyotishAPIHandler(BaseHTTPRequestHandler):
elif path == '/api/vedastro_gateway/enqueue':
result = self._compute_vedastro_gateway_enqueue(body)
self._json(result)
elif path.startswith('/api/vedastro_gateway/jobs/') and path.endswith('/run'):
job_id = path.split('/')[-2]
result = self._compute_vedastro_gateway_run_job(job_id)
if result is None:
self._error_json('Not found', 404, 'ERR_NOT_FOUND')
else:
self._json(result)
elif path == '/api/professional_reading':
result = self._compute_professional_reading(body)
self._json(result)
@@ -1784,6 +1791,11 @@ class JyotishAPIHandler(BaseHTTPRequestHandler):
reference_date=str(reference_date),
)
def _compute_vedastro_gateway_run_job(self, job_id):
from scripts.vedastro_gateway import run_gateway_job
return run_gateway_job(str(job_id))
def _compute_vedastro_gateway_run(self, body):
from scripts.vedastro_gateway import run_gateway_packet