Gregory Ballantine a977ff8cfe
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Refactored some code from the Transcoder class to a separate Repository class
2022-05-06 02:47:56 -04:00

30 lines
860 B
Java

package tech.bitgoblin;
import tech.bitgoblin.config.Config;
import tech.bitgoblin.transcoder.RunTranscoderTask;
import tech.bitgoblin.transcoder.Transcoder;
import java.util.Timer;
/**
* The Bit Goblin video transcoder service.
*
*/
public class App {
private static final String configFile = "~/.config/dragoon.toml";
private static final int msToMinutes = 60 * 1000;
public static void main(String[] args) {
// read our config file
Config c = new Config(configFile);
// create new Transcoder object and start the service
Transcoder t = new Transcoder(c);
Timer timer = new Timer();
timer.scheduleAtFixedRate(new RunTranscoderTask(t), 2500, ((long) c.getInt("transcoder.interval") * msToMinutes));
System.out.printf("Starting transcoder, running in %d minute intervals.%n", c.getInt("transcoder.interval"));
}
}