forked from vieter-v/vieter
Attempt at writing renew_queue function; seems to just stop in the
middle
This commit is contained in:
parent
ff57d73998
commit
f7e1aba30b
10 changed files with 89 additions and 30 deletions
|
|
@ -5,12 +5,13 @@ import time
|
|||
import log
|
||||
import util
|
||||
import cron.daemon
|
||||
import cron.expression
|
||||
|
||||
// cron starts a cron daemon & starts periodically scheduling builds.
|
||||
pub fn cron(conf Config) ? {
|
||||
// Configure logger
|
||||
log_level := log.level_from_tag(conf.log_level) or {
|
||||
util.exit_with_message(1, 'Invalid log level. The allowed values are FATAL, ERROR, WARN, INFO & DEBUG.')
|
||||
return error('Invalid log level. The allowed values are FATAL, ERROR, WARN, INFO & DEBUG.')
|
||||
}
|
||||
|
||||
mut logger := log.Log{
|
||||
|
|
@ -20,5 +21,12 @@ pub fn cron(conf Config) ? {
|
|||
logger.set_full_logpath(conf.log_file)
|
||||
logger.log_to_console_too()
|
||||
|
||||
d := daemon.init(conf)
|
||||
ce := expression.parse_expression(conf.global_schedule) or {
|
||||
return error('Error while parsing global cron expression: $err.msg()')
|
||||
}
|
||||
|
||||
mut d := daemon.init_daemon(logger, conf.address, conf.api_key, conf.base_image, ce,
|
||||
conf.max_concurrent_builds, conf.api_update_frequency) ?
|
||||
|
||||
d.run() ?
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue