mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02:00
Don't retry RDE upload tasks that have failed dependencies
New upload tasks are created every 4 hours, so if we're waiting on a 2 hour SFTP cooldown or some other long-running dependency like generating the RDE report, just delete this task and let it re-run at the next 4 hour period. No need to let these tasks continue gumming up the queue. Note that this method of throwing NoContentException to abort the task without enqueuing it for retry is already being used by RdeReportAction for the same purpose. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201372808
This commit is contained in:
parent
a5cc359813
commit
c8925555d4
5 changed files with 98 additions and 57 deletions
|
@ -94,15 +94,11 @@ class EscrowTaskRunner {
|
|||
if (nextRequiredRun.isAfter(startOfToday)) {
|
||||
throw new NoContentException("Already completed");
|
||||
}
|
||||
logger.atInfo().log("Cursor: %s", nextRequiredRun);
|
||||
logger.atInfo().log("Current cursor is: %s", nextRequiredRun);
|
||||
task.runWithLock(nextRequiredRun);
|
||||
ofy()
|
||||
.transact(
|
||||
() ->
|
||||
ofy()
|
||||
.save()
|
||||
.entity(
|
||||
Cursor.create(cursorType, nextRequiredRun.plus(interval), registry)));
|
||||
DateTime nextRun = nextRequiredRun.plus(interval);
|
||||
logger.atInfo().log("Rolling cursor forward to %s.", nextRun);
|
||||
ofy().transact(() -> ofy().save().entity(Cursor.create(cursorType, nextRun, registry)));
|
||||
return null;
|
||||
};
|
||||
String lockName = String.format("EscrowTaskRunner %s", task.getClass().getSimpleName());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue