Skip to content

Validation of RecurringTask #428

@cedricpim

Description

@cedricpim

I searched but I couldn't find any similar request. I was wondering if it would make sense to add an option to raise an error if any recurring task is invalid?

From what I see, invalid recurring tasks are silently ignored here:

def recurring_tasks
@recurring_tasks ||= recurring_tasks_config.map do |id, options|
RecurringTask.from_configuration(id, **options)
end.select(&:valid?)
end
But it is easy to add a task with a typo and it would go into production and be discarded silently (someone can always check that the records were created but that's a bit time consuming).

I would be up to prepare a PR but wanted to check that this is something SolidQueue team wants.

PS: While writing this, I also thought if having a rake task could be interesting, to make it part of the deployment process for example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions