Skip to content
This repository has been archived by the owner on Dec 2, 2024. It is now read-only.

Commit

Permalink
Fix function name.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsha committed May 31, 2020
1 parent 822f04b commit f8e1b50
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions deleter.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ async function cleanDuplicateAndExternalActions() {
var maxResult = await sequelize.query('SELECT max(id) FROM Actions;');
var max = parseInt(maxResult[0][0]['max(id)']);
for (let offset = 0; offset < max; offset += limit) {
logger.info("cleanDuplicateActions, offset = ", offset);
logger.info("cleanDuplicateAndExternalActions, offset = ", offset);
await sequelize.query('DELETE FROM Actions WHERE (statusNum IN (3, 4, 5, 6, 7, 8, 9, 10) OR causeNum = 0) AND id > ? AND id < ? AND updatedAt < DATE_SUB(NOW(), INTERVAL 10 DAY);',
{
replacements: [offset, offset+limit],
type: sequelize.QueryTypes.DELETE
});
await Q.delay(1000);
}
logger.info("restarting cleanDuplicateActions loop");
logger.info("restarting cleanDuplicateAndExternalActions loop");
await Q.delay(1000);
}
}
Expand Down Expand Up @@ -108,7 +108,7 @@ if (require.main === module) {
processEternally().catch(function(err) {
logger.error(err);
})
cleanDuplicateActions().catch(function(err) {
cleanDuplicateAndExternalActions().catch(function(err) {
logger.error(err);
});
cleanExcessActions().catch(function(err) {
Expand Down

0 comments on commit f8e1b50

Please sign in to comment.