File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,11 @@ export async function syncLogsDb(db: DatabaseService) {
19
19
) ;
20
20
for ( const row of result . rows ) {
21
21
try {
22
- const filePath = row . path ;
23
- fs . openSync ( `${ filePath } ` , 'r' ) ;
22
+ fs . openSync ( `${ row . path } ` , 'r' ) ;
24
23
} catch ( err ) {
25
- console . log ( `janitor: delete database row ${ row . id } ` ) ;
24
+ console . log (
25
+ `janitor: delete database row ${ row . id } ; file missing: ${ row . path } ` ,
26
+ ) ;
26
27
db . deleteLog ( row . id ) ;
27
28
}
28
29
}
Original file line number Diff line number Diff line change @@ -35,9 +35,11 @@ async function main() {
35
35
await rotateLogs ( db ) ;
36
36
} ) ;
37
37
const compressJob = Cron ( CRON_COMPRESS , async ( ) => {
38
+ await syncLogsDb ( db ) ;
38
39
await compress ( db ) ;
39
40
} ) ;
40
41
const backupJob = Cron ( CRON_BACKUP , async ( ) => {
42
+ await syncLogsDb ( db ) ;
41
43
await backup ( db ) ;
42
44
} ) ;
43
45
const janitorJob = Cron ( CRON_JANITOR , async ( ) => {
You can’t perform that action at this time.
0 commit comments