mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-09 16:40:07 -04:00
wip
This commit is contained in:
parent
b9ab8ee78e
commit
ba6036dd7d
18 changed files with 105 additions and 740 deletions
|
@ -4,6 +4,7 @@ const _ = require('lodash')
|
|||
const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs'
|
||||
|
||||
async function main() {
|
||||
await db.programs.reset()
|
||||
const files = await file.list(`${LOGS_DIR}/load-cluster/cluster_*.log`)
|
||||
for (const filepath of files) {
|
||||
const results = await parser.parseLogs(filepath)
|
||||
|
|
|
@ -48,8 +48,9 @@ file.write = function (filepath, data = '') {
|
|||
return fs.writeFile(path.resolve(filepath), data, { encoding: 'utf8' }).catch(console.error)
|
||||
}
|
||||
|
||||
file.clear = function (filepath) {
|
||||
return file.write(filepath, '')
|
||||
file.clear = async function (filepath) {
|
||||
if (await file.exists(filepath)) return file.write(filepath, '')
|
||||
return true
|
||||
}
|
||||
|
||||
file.resolve = function (filepath) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue