fix: improve content cleanup logic

This commit is contained in:
thecodrr
2021-07-03 23:07:43 +05:00
parent fe613fa428
commit d9bbb9fbab
3 changed files with 16 additions and 11 deletions

View File

@@ -96,8 +96,6 @@ class Database {
await this.migrations.migrate();
this.monographs.init();
await this.syncer.cleanup();
}
async connectSSE() {
@@ -114,7 +112,8 @@ class Database {
headers: { Authorization: `Bearer ${token}` },
});
this.evtSource.onopen = function () {
this.evtSource.onopen = async () => {
await this.syncer.cleanup();
console.log("SSE: opened channel successfully!");
};