- const publishedVideos = await sequelizeTypescript.transaction(async t => {
- const schedules = await ScheduleVideoUpdateModel.listVideosToUpdate(t)
- const publishedVideos: MVideoFullLight[] = []
+ const schedules = await ScheduleVideoUpdateModel.listVideosToUpdate()
+ const publishedVideos: MVideoFullLight[] = []
+
+ for (const schedule of schedules) {
+ await sequelizeTypescript.transaction(async t => {
+ const video = await VideoModel.loadFull(schedule.videoId, t)