mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 02:16:40 -05:00
Delete cron package
This commit is contained in:
19
package-lock.json
generated
19
package-lock.json
generated
@@ -29,7 +29,6 @@
|
||||
"cli-progress": "^3.12.0",
|
||||
"commander": "^8.2.0",
|
||||
"consola": "^3.2.3",
|
||||
"cron": "^2.4.3",
|
||||
"csv-parser": "^3.0.0",
|
||||
"cwait": "^1.1.2",
|
||||
"dayjs": "^1.11.10",
|
||||
@@ -3712,15 +3711,6 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/cron": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/cron/-/cron-2.4.3.tgz",
|
||||
"integrity": "sha512-YBvExkQYF7w0PxyeFLRyr817YVDhGxaCi5/uRRMqa4aWD3IFKRd+uNbpW1VWMdqQy8PZ7CElc+accXJcauPKzQ==",
|
||||
"dependencies": {
|
||||
"@types/luxon": "~3.3.0",
|
||||
"luxon": "~3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
@@ -11675,15 +11665,6 @@
|
||||
"optional": true,
|
||||
"peer": true
|
||||
},
|
||||
"cron": {
|
||||
"version": "2.4.3",
|
||||
"resolved": "https://registry.npmjs.org/cron/-/cron-2.4.3.tgz",
|
||||
"integrity": "sha512-YBvExkQYF7w0PxyeFLRyr817YVDhGxaCi5/uRRMqa4aWD3IFKRd+uNbpW1VWMdqQy8PZ7CElc+accXJcauPKzQ==",
|
||||
"requires": {
|
||||
"@types/luxon": "~3.3.0",
|
||||
"luxon": "~3.3.0"
|
||||
}
|
||||
},
|
||||
"cross-spawn": {
|
||||
"version": "7.0.6",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
"cli-progress": "^3.12.0",
|
||||
"commander": "^8.2.0",
|
||||
"consola": "^3.2.3",
|
||||
"cron": "^2.4.3",
|
||||
"csv-parser": "^3.0.0",
|
||||
"cwait": "^1.1.2",
|
||||
"dayjs": "^1.11.10",
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Logger, Timer, Storage, Collection } from '@freearhey/core'
|
||||
import { program } from 'commander'
|
||||
import { CronJob } from 'cron'
|
||||
import { QueueCreator, Job, ChannelsParser } from '../../core'
|
||||
import { Channel } from 'epg-grabber'
|
||||
import path from 'path'
|
||||
@@ -27,7 +26,6 @@ program
|
||||
value => parseInt(value),
|
||||
1
|
||||
)
|
||||
.option('--cron <expression>', 'Schedule a script run (example: "0 0 * * *")')
|
||||
.option('--gzip', 'Create a compressed version of the guide as well', false)
|
||||
.parse(process.argv)
|
||||
|
||||
@@ -41,7 +39,6 @@ export type GrabOptions = {
|
||||
delay?: string
|
||||
lang?: string
|
||||
days?: number
|
||||
cron?: string
|
||||
}
|
||||
|
||||
const options: GrabOptions = program.opts()
|
||||
@@ -79,19 +76,9 @@ async function main() {
|
||||
}
|
||||
logger.info(` found ${parsedChannels.count()} channel(s)`)
|
||||
|
||||
let runIndex = 1
|
||||
if (options.cron) {
|
||||
const cronJob = new CronJob(options.cron, async () => {
|
||||
logger.info(`run #${runIndex}:`)
|
||||
await runJob({ logger, parsedChannels })
|
||||
runIndex++
|
||||
})
|
||||
cronJob.start()
|
||||
} else {
|
||||
logger.info(`run #${runIndex}:`)
|
||||
logger.info(`run:`)
|
||||
runJob({ logger, parsedChannels })
|
||||
}
|
||||
}
|
||||
|
||||
main()
|
||||
|
||||
|
||||
12
yarn.lock
12
yarn.lock
@@ -1048,7 +1048,7 @@
|
||||
resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.199.tgz"
|
||||
integrity sha512-Vrjz5N5Ia4SEzWWgIVwnHNEnb1UE1XMkvY5DGXrAeOGE9imk0hgTHh5GyDjLDJi9OTCn9oo9dXH1uToK1VRfrg==
|
||||
|
||||
"@types/luxon@^3.3.2", "@types/luxon@~3.3.0":
|
||||
"@types/luxon@^3.3.2":
|
||||
version "3.3.2"
|
||||
resolved "https://registry.npmjs.org/@types/luxon/-/luxon-3.3.2.tgz"
|
||||
integrity sha512-l5cpE57br4BIjK+9BSkFBOsWtwv6J9bJpC7gdXIzZyI0vuKvNTk0wZZrkQxMGsUAuGW9+WMNWF2IJMD7br2yeQ==
|
||||
@@ -1944,14 +1944,6 @@ create-require@^1.1.0:
|
||||
resolved "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz"
|
||||
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
|
||||
|
||||
cron@^2.4.3:
|
||||
version "2.4.3"
|
||||
resolved "https://registry.npmjs.org/cron/-/cron-2.4.3.tgz"
|
||||
integrity sha512-YBvExkQYF7w0PxyeFLRyr817YVDhGxaCi5/uRRMqa4aWD3IFKRd+uNbpW1VWMdqQy8PZ7CElc+accXJcauPKzQ==
|
||||
dependencies:
|
||||
"@types/luxon" "~3.3.0"
|
||||
luxon "~3.3.0"
|
||||
|
||||
cross-spawn@^7.0.0, cross-spawn@^7.0.3, cross-spawn@^7.0.6:
|
||||
version "7.0.6"
|
||||
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz"
|
||||
@@ -3701,7 +3693,7 @@ lru-cache@^6.0.0:
|
||||
dependencies:
|
||||
yallist "^4.0.0"
|
||||
|
||||
luxon@^3.3.0, luxon@~3.3.0:
|
||||
luxon@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.npmjs.org/luxon/-/luxon-3.3.0.tgz"
|
||||
integrity sha512-An0UCfG/rSiqtAIiBPO0Y9/zAnHUZxAMiCpTd5h2smgsj7GGmcenvrvww2cqNA8/4A5ZrD1gJpHN2mIHZQF+Mg==
|
||||
|
||||
Reference in New Issue
Block a user