From de3f859deaa542f1f79ea065e1a2ea55ef3a3ea9 Mon Sep 17 00:00:00 2001 From: vexorian Date: Mon, 15 Mar 2021 00:18:23 -0400 Subject: [PATCH] Add flex time so that the next program in time slots happens AFTER the current time. This is specially good for weekly slots, because programming won't start at Thursday for no reason anymore. --- src/services/time-slots-service.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/services/time-slots-service.js b/src/services/time-slots-service.js index dfb53a9..849470e 100644 --- a/src/services/time-slots-service.js +++ b/src/services/time-slots-service.js @@ -325,6 +325,9 @@ module.exports = async( programs, schedule ) => { } } + if (ts > t0) { + pushFlex( ts - t0 ); + } while ( (t < hardLimit) && (p.length < LIMIT) ) { await throttle(); //ensure t is padded