@stamhoofd/backend-backup 2.83.0 → 2.83.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/helpers/backup.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stamhoofd/backend-backup",
|
|
3
|
-
"version": "2.83.
|
|
3
|
+
"version": "2.83.2",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "b2f1dbec97a98ef6bc1f04ddeb28f7455078c3bb"
|
|
38
38
|
}
|
package/src/helpers/backup.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { QueueHandler } from '@stamhoofd/queues';
|
|
|
17
17
|
// Since well create a backup every day, keeping 1000 binary logs would give
|
|
18
18
|
// a full history of 40 days - and leaves us enough margin in case more
|
|
19
19
|
// logs are created in a day
|
|
20
|
-
const MAX_BINARY_LOGS =
|
|
20
|
+
const MAX_BINARY_LOGS = 200;
|
|
21
21
|
const MAX_BACKUPS = 30; // in days
|
|
22
22
|
const BACKUP_PREFIX = 'backup-';
|
|
23
23
|
const BINARY_LOG_PREFIX = 'binlog.';
|
|
@@ -78,7 +78,7 @@ export function getHealth(): BackupHealth {
|
|
|
78
78
|
if (LAST_BACKUP.date.getTime() - now.getTime() > 60 * 60 * 1000 * 25) {
|
|
79
79
|
status = 'error';
|
|
80
80
|
}
|
|
81
|
-
if (LAST_BACKUP.size < 1 * 1000 * 1000) {
|
|
81
|
+
if (LAST_BACKUP.size < (STAMHOOFD.MINIMUM_BACKUP_SIZE ?? 1 * 1000 * 1000)) {
|
|
82
82
|
status = 'error';
|
|
83
83
|
}
|
|
84
84
|
}
|