mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update save-results.js
This commit is contained in:
parent
6448aae5f8
commit
127f9f2259
1 changed files with 5 additions and 4 deletions
|
@ -7,8 +7,9 @@ async function main() {
|
||||||
await db.programs.reset()
|
await db.programs.reset()
|
||||||
const files = await file.list(`${LOGS_DIR}/load-cluster/cluster_*.log`)
|
const files = await file.list(`${LOGS_DIR}/load-cluster/cluster_*.log`)
|
||||||
for (const filepath of files) {
|
for (const filepath of files) {
|
||||||
|
logger.info(`Parsing "${filepath}"...`)
|
||||||
const results = await parser.parseLogs(filepath)
|
const results = await parser.parseLogs(filepath)
|
||||||
results.forEach(result => {
|
for (const result of results) {
|
||||||
const programs = result.programs.map(program => {
|
const programs = result.programs.map(program => {
|
||||||
program.site = result.site
|
program.site = result.site
|
||||||
program.country = result.country
|
program.country = result.country
|
||||||
|
@ -16,10 +17,10 @@ async function main() {
|
||||||
|
|
||||||
return program
|
return program
|
||||||
})
|
})
|
||||||
db.programs.insert(programs)
|
|
||||||
})
|
await db.programs.insert(programs)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
db.programs.compact()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue