updated Services Task database
This commit is contained in:
@@ -11,6 +11,7 @@ COPY app/services/parser/comment/README.md ./
|
||||
COPY app/core ./app/core
|
||||
COPY app/services/common/ ./app/services/common/
|
||||
COPY app/services/parser/comment/ ./app/services/parser/comment/
|
||||
COPY app/services/types/ ./app/services/types/
|
||||
|
||||
RUN pip install --upgrade pip && pip install --no-cache-dir .
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import asyncio
|
||||
|
||||
from app.services.common.service_base_async import ServiceBaseAsync, Job
|
||||
from app.services.common.service_base_async import ServiceBaseAsync
|
||||
from app.services.types.queue import Enqueue
|
||||
from app.services.types.task import Job
|
||||
from app.services.types.mail import MailParsedResult
|
||||
from app.services.types.mail import PlainMailReader
|
||||
from app.services.types.mail import ProcessMailObject
|
||||
|
||||
|
||||
PROCESS_SEC = 10
|
||||
@@ -12,10 +17,11 @@ async def produce(_svc: ServiceBaseAsync):
|
||||
|
||||
|
||||
async def handle_excel_publish(svc: ServiceBaseAsync, job: dict):
|
||||
print("Parser Comment Consumer from excel handle_excel_publish :", job)
|
||||
job_model = Job(**job)
|
||||
mail_id = job_model.payload['mail_id']
|
||||
task_id = f"IsBankServiceMailParser_{mail_id}"
|
||||
await svc.enqueue(task_id=task_id, payload=job_model.payload, type_="parser.comment.publish")
|
||||
task_id = f"IsBankServiceCommentParser_{mail_id}"
|
||||
await svc.enqueue(task_id=task_id, payload=job_model.payload, action="parser.comment.publish")
|
||||
print("Parser Comment Consumer from excel handle_excel_publish :", job_model.task_id)
|
||||
await svc.ack_current()
|
||||
await asyncio.sleep(PROCESS_SEC)
|
||||
|
||||
Reference in New Issue
Block a user