|
@@ -84,16 +84,19 @@ public class DatabaseTableMeta implements TableMetaTSDB {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void run() {
|
|
public void run() {
|
|
|
|
+ boolean applyResult = false;
|
|
try {
|
|
try {
|
|
MDC.put("destination", destination);
|
|
MDC.put("destination", destination);
|
|
- applySnapshotToDB(lastPosition, false);
|
|
|
|
|
|
+ applyResult = applySnapshotToDB(lastPosition, false);
|
|
} catch (Throwable e) {
|
|
} catch (Throwable e) {
|
|
logger.error("scheudle applySnapshotToDB faield", e);
|
|
logger.error("scheudle applySnapshotToDB faield", e);
|
|
}
|
|
}
|
|
|
|
|
|
try {
|
|
try {
|
|
MDC.put("destination", destination);
|
|
MDC.put("destination", destination);
|
|
- snapshotExpire((int) TimeUnit.HOURS.toSeconds(snapshotExpire));
|
|
|
|
|
|
+ if (applyResult) {
|
|
|
|
+ snapshotExpire((int) TimeUnit.HOURS.toSeconds(snapshotExpire));
|
|
|
|
+ }
|
|
} catch (Throwable e) {
|
|
} catch (Throwable e) {
|
|
logger.error("scheudle snapshotExpire faield", e);
|
|
logger.error("scheudle snapshotExpire faield", e);
|
|
}
|
|
}
|