mirror of
https://github.com/google/nomulus
synced 2026-05-21 07:11:48 +00:00
Migrate to Flogger (green)
This is a 'green' Flogger migration CL. Green CLs are intended to be as safe as possible and should be easy to review and submit. No changes should be necessary to the code itself prior to submission, but small changes to BUILD files may be required. Changes within files are completely independent of each other, so this CL can be safely split up for review using tools such as Rosie. For more information, see [] Base CL: 197826149 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=198560170
This commit is contained in:
@@ -16,7 +16,7 @@ package google.registry.rde;
|
||||
|
||||
import static google.registry.model.ofy.ObjectifyService.ofy;
|
||||
|
||||
import com.google.common.logging.FormattingLogger;
|
||||
import com.google.common.flogger.FluentLogger;
|
||||
import google.registry.model.common.Cursor;
|
||||
import google.registry.model.common.Cursor.CursorType;
|
||||
import google.registry.model.registry.Registry;
|
||||
@@ -64,7 +64,7 @@ class EscrowTaskRunner {
|
||||
void runWithLock(DateTime watermark) throws Exception;
|
||||
}
|
||||
|
||||
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
|
||||
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
|
||||
|
||||
@Inject Clock clock;
|
||||
@Inject LockHandler lockHandler;
|
||||
@@ -87,14 +87,14 @@ class EscrowTaskRunner {
|
||||
final Duration interval) {
|
||||
Callable<Void> lockRunner =
|
||||
() -> {
|
||||
logger.infofmt("TLD: %s", registry.getTld());
|
||||
logger.atInfo().log("TLD: %s", registry.getTld());
|
||||
DateTime startOfToday = clock.nowUtc().withTimeAtStartOfDay();
|
||||
Cursor cursor = ofy().load().key(Cursor.createKey(cursorType, registry)).now();
|
||||
final DateTime nextRequiredRun = (cursor == null ? startOfToday : cursor.getCursorTime());
|
||||
if (nextRequiredRun.isAfter(startOfToday)) {
|
||||
throw new NoContentException("Already completed");
|
||||
}
|
||||
logger.infofmt("Cursor: %s", nextRequiredRun);
|
||||
logger.atInfo().log("Cursor: %s", nextRequiredRun);
|
||||
task.runWithLock(nextRequiredRun);
|
||||
ofy()
|
||||
.transact(
|
||||
|
||||
Reference in New Issue
Block a user