mirror of
https://codeberg.org/timelimit/timelimit-server.git
synced 2026-08-31 19:03:45 +02:00
Update dependencies
This commit is contained in:
@@ -44,7 +44,7 @@ async function deleteDeprecatedPurchases ({ database, websocket }: {
|
||||
websocket: WebsocketApi
|
||||
}) {
|
||||
await database.transaction(async (transaction) => {
|
||||
const affectedFamilyIds = await database.family.findAll({
|
||||
const affectedFamilyIds = (await database.family.findAll({
|
||||
where: {
|
||||
hasFullVersion: true,
|
||||
fullVersionUntil: {
|
||||
@@ -55,14 +55,16 @@ async function deleteDeprecatedPurchases ({ database, websocket }: {
|
||||
transaction,
|
||||
lock: Sequelize.Transaction.LOCK.UPDATE,
|
||||
limit: 100
|
||||
}).map((item) => item.familyId)
|
||||
})).map((item) => item.familyId)
|
||||
|
||||
await database.family.update({
|
||||
hasFullVersion: false
|
||||
}, {
|
||||
where: {
|
||||
familyid: {
|
||||
[Sequelize.Op.in]: affectedFamilyIds
|
||||
familyId: {
|
||||
[Sequelize.Op.in]: {
|
||||
affectedFamilyIds
|
||||
}
|
||||
}
|
||||
},
|
||||
transaction
|
||||
|
||||
@@ -45,7 +45,7 @@ async function deleteOldUsedTimes ({ database }: {
|
||||
|
||||
await database.transaction(async (transaction) => {
|
||||
// get matching categories
|
||||
const categoriesToCleanUpOne = await database.usedTime.findAll({
|
||||
const categoriesToCleanUpOne = (await database.usedTime.findAll({
|
||||
transaction,
|
||||
where: {
|
||||
lastUpdate: {
|
||||
@@ -58,12 +58,12 @@ async function deleteOldUsedTimes ({ database }: {
|
||||
],
|
||||
limit: 1000,
|
||||
order: [['lastUpdate', 'ASC']]
|
||||
}).map((item) => ({
|
||||
})).map((item) => ({
|
||||
familyId: item.familyId,
|
||||
categoryId: item.categoryId
|
||||
}))
|
||||
|
||||
const categoriesToCleanUpTwo = await database.sessionDuration.findAll({
|
||||
const categoriesToCleanUpTwo = (await database.sessionDuration.findAll({
|
||||
transaction,
|
||||
where: {
|
||||
roundedLastUpdate: {
|
||||
@@ -76,7 +76,7 @@ async function deleteOldUsedTimes ({ database }: {
|
||||
],
|
||||
limit: 1000,
|
||||
order: [['roundedLastUpdate', 'ASC']]
|
||||
}).map((item) => ({
|
||||
})).map((item) => ({
|
||||
familyId: item.familyId,
|
||||
categoryId: item.categoryId
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user