Result::TaskRetries: Teach about requeue
This commit is contained in:
@ -105,6 +105,16 @@ __PACKAGE__->set_primary_key("id");
|
||||
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-08-26 16:30:59
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4MC8UnsgrvJVRrIURvSH5A
|
||||
|
||||
use Hydra::Math qw(exponential_backoff);
|
||||
|
||||
sub requeue {
|
||||
my ($self) = @_;
|
||||
|
||||
$self->update({
|
||||
attempts => $self->attempts + 1,
|
||||
retry_at => time() + exponential_backoff($self->attempts + 1),
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
# You can replace this text with custom code or comments, and it will be preserved on regeneration
|
||||
1;
|
||||
|
Reference in New Issue
Block a user