queue
This commit is contained in:
parent
569aefeccb
commit
3845cc7ecf
3 changed files with 62 additions and 5 deletions
|
|
@ -1,23 +1,30 @@
|
|||
import uuid
|
||||
from typing import Annotated
|
||||
|
||||
from injectable import injectable, autowired, Autowired
|
||||
|
||||
from app.core.queue import EnqueuedProcessor, ProcessQueue, Task, Result
|
||||
from app.model.healthcheck import HealthCheck
|
||||
from app.model.webhook import WebhookEvent
|
||||
from app.services import DockerService, GitService, Passwords
|
||||
|
||||
|
||||
@injectable
|
||||
class WebhookProcessor:
|
||||
@injectable(singleton=True)
|
||||
class WebhookProcessor(EnqueuedProcessor):
|
||||
@autowired
|
||||
def __init__(self, docker: Annotated[DockerService, Autowired],
|
||||
git: Annotated[GitService, Autowired],
|
||||
keepass: Annotated[Passwords, Autowired]):
|
||||
keepass: Annotated[Passwords, Autowired],
|
||||
queue: Annotated[ProcessQueue, Autowired]):
|
||||
super().__init__(queue)
|
||||
self._docker = docker
|
||||
self._git = git
|
||||
self._keepass = keepass
|
||||
|
||||
def process_ci_event(self, event: WebhookEvent):
|
||||
def enqueue(self, event: WebhookEvent):
|
||||
self._enqueue(Task(uuid.UUID(), self, event))
|
||||
|
||||
def _process(self, task: Task) -> Result:
|
||||
pass
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue