mirror of
https://github.com/alibaba/canal.git
synced 2026-11-04 00:30:15 +08:00
fixed snapshot expire
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user