bundles/travelynx: use worker service instead of cronjob
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-08-19 21:51:03 +02:00
parent 1392ce3c58
commit 15dbc4307f
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 26 additions and 3 deletions

View file

@ -0,0 +1,15 @@
[Unit]
Description=Travelynx Railway Checkin Service - Worker
After=network.target
[Service]
ExecStart=/usr/bin/perl index.pl worker
User=travelynx
WorkingDirectory=/opt/travelynx
Environment=LANG=en_US.UTF-8
Environment=PERL5LIB=/opt/travelynx/local/lib/perl5
[Install]
WantedBy=multi-user.target

View file

@ -16,6 +16,11 @@ files = {
'action:systemd-reload',
},
},
'/etc/systemd/system/travelynx-worker.service': {
'triggers': {
'action:systemd-reload',
},
},
'/opt/travelynx/travelynx.conf': {
'content_type': 'mako',
'context': node.metadata['travelynx'],
@ -73,4 +78,10 @@ svc_systemd = {
'directory:/var/cache/travelynx',
},
},
'travelynx-worker': {
'needs': {
'file:/etc/systemd/system/travelynx-worker.service',
'svc_systemd:travelynx',
},
},
}

View file

@ -5,9 +5,6 @@ defaults = {
'deploy_configs': False,
},
},
'cron': {
'travelynx': '*/3 * * * * travelynx cd /opt/travelynx && timeout 5m perl index.pl work -m production',
},
'travelynx': {
'database': {
'username': 'travelynx',