mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2025-10-06 03:50:05 +02:00
Add logging background worker execution
This commit is contained in:
parent
82230f6c40
commit
98819fa2d5
4 changed files with 23 additions and 7 deletions
|
@ -25,7 +25,11 @@ export function initDeleteDeprecatedPurchasesWorker ({ database, websocket }: {
|
|||
websocket: WebsocketApi
|
||||
}) {
|
||||
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)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
|
@ -22,7 +22,11 @@ export function initDeleteOldFamiliesWorker ({ database }: {
|
|||
database: Database
|
||||
}) {
|
||||
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)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
|
@ -22,7 +22,11 @@ export function initDeleteOldTokensWorker ({ database }: {
|
|||
database: Database
|
||||
}) {
|
||||
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)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* 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
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
|
@ -24,7 +24,11 @@ export function initDeleteOldUsedTimesWorker ({ database }: {
|
|||
database: Database
|
||||
}) {
|
||||
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)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue