Improve logging

This commit is contained in:
Chocobozzz 2020-10-23 09:46:41 +02:00
parent 3836005171
commit a478b5f893
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 7 additions and 1 deletions

View File

@ -20,7 +20,11 @@ export abstract class AbstractScheduler {
}
async execute () {
if (this.isRunning === true) return
if (this.isRunning === true) {
logger.info('Do not run scheduler %s because the process is already running.', this.constructor.name)
return
}
this.isRunning = true
try {

View File

@ -97,6 +97,8 @@ export class VideosIndexer extends AbstractScheduler {
let videos: IndexableVideo[] = []
let start = 0
logger.info('Adding video data from %s.', host)
do {
videos = await getVideos(host, start)
start += videos.length