1 Commits

Author SHA1 Message Date
6db2c2d683 v3.3.1: configurable sync frequency 2024-02-15 03:47:05 -05:00
4 changed files with 5 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ create `config/config.json`:
| apprise | The URL of the Apprise instance for sending notifications |
| maintainers | Array of maintainer names as strings or objects containing the `name` of the maintainer and a list of `channels` to send notifications to |
| cron | The cron schedule for when the application should check for pending operations via [artix-checkupdates](https://gitea.artixlinux.org/artix/artix-checkupdates) |
| syncfreq | How often (in days) should the application sync package ownership from Gitea |
| port | What port to run the webserver on (defaults to 8080) |
| savePath | Location of auxiliary save data (defaults to `config/data.db`) |
| db | Location of the SQLite DB (defaults to `config/packages.db`) |

View File

@@ -68,7 +68,7 @@ async function main(config, db) {
console.log('Starting scheduled task');
cronjob.stop();
let now = dayjs();
if (!('last-sync' in saveData) || !saveData['last-sync'] || dayjs(saveData['last-sync']).isBefore(now.subtract(3, 'days'))) {
if (!('last-sync' in saveData) || !saveData['last-sync'] || dayjs(saveData['last-sync']).isBefore(now.subtract(process.env.SYNCFREQ || config.syncfreq || 2, 'days'))) {
ircBot.close();
await updateMaintainers(config, db);
saveData['last-sync'] = now.toJSON();

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "artix-packy-notifier",
"version": "3.3.0",
"version": "3.3.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "artix-packy-notifier",
"version": "3.3.0",
"version": "3.3.1",
"license": "MIT",
"dependencies": {
"better-sqlite3": "9.4.0",

View File

@@ -1,6 +1,6 @@
{
"name": "artix-packy-notifier",
"version": "3.3.0",
"version": "3.3.1",
"description": "Determine packages that need attention",
"main": "index.js",
"scripts": {