File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
.idea /
2
2
node_modules /
3
+ vuetorrent /
3
4
.env
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import cors from 'cors'
3
3
import { config } from 'dotenv'
4
4
import express , { Router } from 'express'
5
5
import morgan from 'morgan'
6
- import { scheduleJob } from 'node-schedule'
6
+ import scheduler from 'node-schedule'
7
7
import authMiddleware from './middlewares/auth.js'
8
8
import configRouter from './routers/config/index.js'
9
9
import qbitRouter from './routers/qbit/index.js'
@@ -56,7 +56,7 @@ const server = app.listen(PORT, async () => {
56
56
57
57
const update_cron = process . env . UPDATE_VT_CRON
58
58
if ( update_cron && update_cron . length ) {
59
- scheduleJob (
59
+ scheduler . scheduleJob (
60
60
'Update VueTorrent' ,
61
61
update_cron ,
62
62
async ( ) => {
@@ -69,6 +69,7 @@ const server = app.listen(PORT, async () => {
69
69
async function stopServer ( signal ) {
70
70
console . log ( `Received ${ signal } signal. Gracefully shutting down...` )
71
71
server . close ( )
72
+ await scheduler . gracefulShutdown ( )
72
73
}
73
74
74
75
process . on ( 'SIGTERM' , stopServer )
You can’t perform that action at this time.
0 commit comments