mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Add logging background worker execution
This commit is contained in:
@@ -25,7 +25,11 @@ export function initDeleteDeprecatedPurchasesWorker ({ database, websocket }: {
|
|||||||
websocket: WebsocketApi
|
websocket: WebsocketApi
|
||||||
}) {
|
}) {
|
||||||
function doWorkSafe () {
|
function doWorkSafe () {
|
||||||
deleteDeprecatedPurchases({ database, websocket }).catch((ex) => {
|
console.log('deleting deprecated purchases now')
|
||||||
|
|
||||||
|
deleteDeprecatedPurchases({ database, websocket }).then(() => {
|
||||||
|
console.log('finished deleting deprecated purchases')
|
||||||
|
}).catch((ex) => {
|
||||||
console.warn('error deleting deprecated purchases', ex)
|
console.warn('error deleting deprecated purchases', ex)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 Jonas Lochmann
|
* Copyright (C) 2019 - 2021 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -22,7 +22,11 @@ export function initDeleteOldFamiliesWorker ({ database }: {
|
|||||||
database: Database
|
database: Database
|
||||||
}) {
|
}) {
|
||||||
function doWorkSafe () {
|
function doWorkSafe () {
|
||||||
deleteOldFamilies(database).catch((ex) => {
|
console.log('deleting old families now')
|
||||||
|
|
||||||
|
deleteOldFamilies(database).then(() => {
|
||||||
|
console.log('finished deleting old families')
|
||||||
|
}).catch((ex) => {
|
||||||
console.warn('error deleting old families', ex)
|
console.warn('error deleting old families', ex)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 Jonas Lochmann
|
* Copyright (C) 2019 - 2021 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -22,7 +22,11 @@ export function initDeleteOldTokensWorker ({ database }: {
|
|||||||
database: Database
|
database: Database
|
||||||
}) {
|
}) {
|
||||||
function doWorkSafe () {
|
function doWorkSafe () {
|
||||||
deleteOldTokens({ database }).catch((ex) => {
|
console.log('deleting old tokens now')
|
||||||
|
|
||||||
|
deleteOldTokens({ database }).then(() => {
|
||||||
|
console.log('finished deleting old tokens')
|
||||||
|
}).catch((ex) => {
|
||||||
console.warn('error deleting old tokens', ex)
|
console.warn('error deleting old tokens', ex)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* server component for the TimeLimit App
|
* server component for the TimeLimit App
|
||||||
* Copyright (C) 2019 - 2020 Jonas Lochmann
|
* Copyright (C) 2019 - 2021 Jonas Lochmann
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
@@ -24,7 +24,11 @@ export function initDeleteOldUsedTimesWorker ({ database }: {
|
|||||||
database: Database
|
database: Database
|
||||||
}) {
|
}) {
|
||||||
function doWorkSafe () {
|
function doWorkSafe () {
|
||||||
deleteOldUsedTimes({ database }).catch((ex) => {
|
console.log('deleting old used times now')
|
||||||
|
|
||||||
|
deleteOldUsedTimes({ database }).then(() => {
|
||||||
|
console.log('finished deleting old used times')
|
||||||
|
}).catch((ex) => {
|
||||||
console.warn('error deleting old used times', ex)
|
console.warn('error deleting old used times', ex)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user