Skip to content

Better job queueing system #30

@pmdevita

Description

@pmdevita

GRB could use a better queueing system.

Currently, the inbox is treated as the queue and while this works, it can be rather crude and it lacks certain features or the ability to add metadata to a video in the queue.

This is somewhat problematic in situations where a gif hosting website goes down. The bot might need to wait for it to come back up but all it can do is either crash or continually retry over and over to reverse and upload. It's a brute-force way of handling the problem, whereas a real queue could make for a more elegant solution.

For example, if Catbox was to go down and a certain job could only be uploaded to that location, we could save the completed reversed gif and add some metadata to the job in the queue, saying we are waiting for Catbox to return online (we should probably also message the operator). GifHost objects could then implement a method for checking if a site is online and the bot could ping every now and then, waiting for the site to come online so it can complete the task.

The job queue would need to have a representation in the database to avoid state-related problems. Make the ID of each job the same as the ID of the incoming message to prevent duplicates in the rare condition it tries to enter a job twice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions