bundles/travelynx: use worker service instead of cronjob
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
1392ce3c58
commit
15dbc4307f
3 changed files with 26 additions and 3 deletions
15
bundles/travelynx/files/travelynx-worker.service
Normal file
15
bundles/travelynx/files/travelynx-worker.service
Normal 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
|
|
@ -16,6 +16,11 @@ files = {
|
||||||
'action:systemd-reload',
|
'action:systemd-reload',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'/etc/systemd/system/travelynx-worker.service': {
|
||||||
|
'triggers': {
|
||||||
|
'action:systemd-reload',
|
||||||
|
},
|
||||||
|
},
|
||||||
'/opt/travelynx/travelynx.conf': {
|
'/opt/travelynx/travelynx.conf': {
|
||||||
'content_type': 'mako',
|
'content_type': 'mako',
|
||||||
'context': node.metadata['travelynx'],
|
'context': node.metadata['travelynx'],
|
||||||
|
@ -73,4 +78,10 @@ svc_systemd = {
|
||||||
'directory:/var/cache/travelynx',
|
'directory:/var/cache/travelynx',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
'travelynx-worker': {
|
||||||
|
'needs': {
|
||||||
|
'file:/etc/systemd/system/travelynx-worker.service',
|
||||||
|
'svc_systemd:travelynx',
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,6 @@ defaults = {
|
||||||
'deploy_configs': False,
|
'deploy_configs': False,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'cron': {
|
|
||||||
'travelynx': '*/3 * * * * travelynx cd /opt/travelynx && timeout 5m perl index.pl work -m production',
|
|
||||||
},
|
|
||||||
'travelynx': {
|
'travelynx': {
|
||||||
'database': {
|
'database': {
|
||||||
'username': 'travelynx',
|
'username': 'travelynx',
|
||||||
|
|
Loading…
Add table
Reference in a new issue