check db first
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Successful in 1m5s
Deploy service message-delivery-method-web-push / service message-delivery-method-web-push (push) Successful in 1m5s
This commit is contained in:
@@ -22,7 +22,9 @@ function limitStringLengthWithEllipsis(str: string, maxLength: number): string {
|
||||
}
|
||||
|
||||
const start = async () => {
|
||||
const checkedDatabases = await checkDatabases();
|
||||
await setupVapidDetails();
|
||||
|
||||
const serviceSeqTracker = await ServiceSeqTracker.Init(
|
||||
"_local/service:message-delivery-method-web-push",
|
||||
);
|
||||
@@ -51,18 +53,14 @@ const start = async () => {
|
||||
});
|
||||
|
||||
console.info("Service started from sequence", serviceSeqTracker.lastSeq);
|
||||
|
||||
// check dbs
|
||||
await checkDatabases().then(({ messagesDb }) => {
|
||||
if (
|
||||
parseInt(serviceSeqTracker.lastSeq.toString(), 10) ===
|
||||
parseInt(messagesDb.update_seq.toString(), 10)
|
||||
parseInt(checkedDatabases.messagesDb.update_seq.toString(), 10)
|
||||
) {
|
||||
console.log("Since is the last seq");
|
||||
} else {
|
||||
console.log("Last seq is", messagesDb.update_seq);
|
||||
console.log("Last seq is", checkedDatabases.messagesDb.update_seq);
|
||||
}
|
||||
});
|
||||
|
||||
await startHealthServer(abortController);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user