Change job scheduling to be relative rather than absolute.

This commit is contained in:
Greyson Parrelli
2023-08-30 09:51:08 -04:00
committed by Nicholas Tinsley
parent 64babe2e42
commit a911a007d2
10 changed files with 199 additions and 121 deletions

View File

@@ -37,9 +37,9 @@ public final class RateLimitUtil {
ApplicationDependencies.getJobManager().update((job) -> {
if (job.getFactoryKey().equals(IndividualSendJob.KEY) && messageIds.contains(IndividualSendJob.getMessageId(job.getSerializedData()))) {
return job.withNextRunAttemptTime(System.currentTimeMillis());
return job.withNextBackoffInterval(0);
} else if (job.getFactoryKey().equals(PushGroupSendJob.KEY) && messageIds.contains(PushGroupSendJob.getMessageId(job.getSerializedData()))) {
return job.withNextRunAttemptTime(System.currentTimeMillis());
return job.withNextBackoffInterval(0);
} else {
return job;
}