diff --git a/src/crawler/movieSchduleCrawler.ts b/src/crawler/movieSchduleCrawler.ts index b717d73..acfb68c 100644 --- a/src/crawler/movieSchduleCrawler.ts +++ b/src/crawler/movieSchduleCrawler.ts @@ -23,7 +23,9 @@ export async function crawlMovieSchdule(scheduleUrl, date) { }); } catch (error) { + console.error('crawlMovieSchdule fail!'); console.error(error); } + console.log(`crawlMovieSchdule(${scheduleUrl}, ${date}), schedules.length: ${schedules.length}`) return schedules; } \ No newline at end of file diff --git a/src/task/atmoviesTask.ts b/src/task/atmoviesTask.ts index 238c190..9b597af 100644 --- a/src/task/atmoviesTask.ts +++ b/src/task/atmoviesTask.ts @@ -15,11 +15,13 @@ export async function updateMoviesSchedules() { .find({}, { projection: { scheduleUrl: 1, _id: 0 } }) .toArray(); const scheduleCrawlDate = await getScheduleCrawlDate(); + console.log('scheduleCrawlDate', scheduleCrawlDate); let schedulesPromise = scheduleUrls.map(({ scheduleUrl }) => crawlMovieSchdule(scheduleUrl, scheduleCrawlDate) ); const schedules = await Promise.all(schedulesPromise); const allSchedules: Schedule[] = [].concat(...schedules); + console.log('allSchedules.length', allSchedules.length); redisClient.setex(scheduleCrawlDate, 86400 * 2, JSON.stringify(allSchedules)); return allSchedules; }