Merge branch 'stable-2.15'

* stable-2.15:
  GarbageCollectionRunner: Don't log missing config in gc_log
  Schema_109: Fix SQL syntax error
  Schema_109: Keep old timestamps during data migration

Change-Id: I9c41d9b4d2e7e2ec57636257b95605f1425dcdbf
This commit is contained in:
David Pursehouse
2017-11-01 08:15:59 +09:00
2 changed files with 4 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory;
/** Runnable to enable scheduling gc to run periodically */
public class GarbageCollectionRunner implements Runnable {
private static final Logger gcLog = LoggerFactory.getLogger(GarbageCollection.LOG_NAME);
private static final Logger log = LoggerFactory.getLogger(GarbageCollectionRunner.class);
static class Lifecycle implements LifecycleListener {
private final WorkQueue queue;
@@ -49,9 +50,9 @@ public class GarbageCollectionRunner implements Runnable {
long interval = scheduleConfig.getInterval();
long delay = scheduleConfig.getInitialDelay();
if (delay == MISSING_CONFIG && interval == MISSING_CONFIG) {
gcLog.info("Ignoring missing gc schedule configuration");
log.info("Ignoring missing gc schedule configuration");
} else if (delay < 0 || interval <= 0) {
gcLog.warn(String.format("Ignoring invalid gc schedule configuration: %s", scheduleConfig));
log.warn(String.format("Ignoring invalid gc schedule configuration: %s", scheduleConfig));
} else {
@SuppressWarnings("unused")
Future<?> possiblyIgnoredError =

View File

@@ -29,7 +29,7 @@ public class Schema_109 extends SchemaVersion {
@Override
protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException {
try (StatementExecutor e = newExecutor(db)) {
e.execute("UPDATE changes SET status = 'n' WHERE status = 's'");
e.execute("UPDATE changes SET status = 'n', created_on = created_on WHERE status = 's'");
}
}
}