#!/sbin/openrc-run
# OpenRC twin of yes-import.timer + yes-import.service: hourly full importer, 2 min after start, 5 min jitter.
description="YES importer (RedTube public API, polite rate limit) every hour"
supervisor=supervise-daemon
command=/usr/bin/ctg-timerd
# the importer needs the env files too: ctg-timerd runs it through env.sh (below)
command_args="--name yes-import --boot-delay 120 --every 3600 --jitter 300 --user yes-site --stop-timeout 120 -- /usr/libexec/yes-site/run-with-env /usr/bin/yes-site import"
pidfile="/run/${RC_SVCNAME}.pid"
retry="TERM/120/KILL/5"

depend() {
	need net
	use dns
	after yes-site
}
