AlmaLinux / AlmaLinux/build-system

Keep track of background tasks statuses

Aberta
#259 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Sem dados de linguagem
Estrelas
32
Forks
11
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

We explored the possibility to keep track of background tasks that are sent.

This would involve:
- Creating a new table background_tasks in db that includes the build task (or release, or whatever task that is done through dramatiq), status and tiimestamp
- Create a small middleware that updates the records in the background_tasks table

The most interesting background tasks to track are the build-related ones, but can also be applied to anything we do with dramatiq.

Here’s a small example of the middleware we can create
```
class MyMiddleware(Middleware):
def after_process_message(self, _broker, _message, *, result=None, exception=None):
print("after_process_message, result:", result)

def before_process_message(self, _broker, _message):
print("before_process_message")

def after_enqueue(self, _broker, _message, _delay):
print("after_enqueue")

def before_enqueue(self, _broker, _message, _delay):
print("before_enqueue")

def before_ack(self, _broker, _message):
print("before_ack")

rabbitmq_broker = RabbitmqBroker(
url=f"amqp://:@:/",
middleware=[MyMiddleware()]
)
dramatiq.set_broker(rabbitmq_broker)
```

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.