YD
05/01/2023, 7:20 PMnohup prefect agent start --work-queue "<name>" > ~/tmp/prefect_agent.log &
It use to work fine, but recently I notices it becomes “unhealthy” and stops running flows.
any idea why this might happen and how to prevent this ?
thanksStéphan Taljaard
05/01/2023, 7:23 PMYD
05/01/2023, 7:37 PMnohup
?Stéphan Taljaard
05/01/2023, 7:41 PM# This file goes in /etc/systemd/system/prefect_agent.service
# It is to start the long-running service for Prefect's LocalAgent
[Unit]
Description="Run Prefect Local Agent"
After=prefect_server.service
[Service]
User=prefect
WorkingDirectory=/home/prefect/prefect
EnvironmentFile=/etc/default/prefect_agent_keys.key
# Need to spell out poetry because ExecStart needs absolute paths
ExecStart=/home/prefect/.poetry/bin/poetry run \
prefect agent start --work-queue default aap-data-transfer
Restart=on-failure
RestartSec=180
# Run this service anytime the system boots:
[Install]
WantedBy=multi-user.target
I now run my agents manually in tmux windows, but tbh I should move back to using something to restart the service when it failsYD
05/01/2023, 7:44 PM