Made the transcoder run as a periodic task, with the interval defined in the config TOML file
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
2022-05-04 00:40:25 -04:00
parent 347211d566
commit 5bde5bfee0
4 changed files with 78 additions and 8 deletions

View File

@ -1,7 +1,10 @@
package tech.bitgoblin;
import tech.bitgoblin.config.Config;
import tech.bitgoblin.video.Transcoder;
import tech.bitgoblin.transcoder.RunTranscoderTask;
import tech.bitgoblin.transcoder.Transcoder;
import java.util.Timer;
/**
* The Bit Goblin video transcoder service.
@ -16,7 +19,8 @@ public class App {
Config c = new Config(configFile);
// create new Transcoder object and start the service
Transcoder t = new Transcoder(c);
t.transcode();
Timer timer = new Timer();
timer.scheduleAtFixedRate(new RunTranscoderTask(t), 2500, 120 * 1000);
}
}