What does your cleanup job look like?
#!/bin/bash
result=""
while [[ "$result" != *" 0 rows affected"* ]]; do
result=$(mysql -u traccar1 -pPassword new_d -vve "DELETE FROM tc_positions WHERE fixTime < DATE(DATE_ADD(NOW(), INTERVAL -60 DAY)) AND id NOT IN (SELECT positionId FROM tc_devices WHERE positionid IS NOT NULL) LIMIT 10000")
sleep 1
done
result=""
while [[ "$result" != *" 0 rows affected"* ]]; do
result=$(mysql -u traccar1 -pPassword new_d -vve "DELETE FROM tc_events WHERE eventTime < DATE(DATE_ADD(NOW(), INTERVAL -60 DAY)) LIMIT 10000")
sleep 1
done
And do you have the right indexes? How does does it take to execute each query?
Hello everyone,
I’m encountering an issue with the HikariCP connection pool in Traccar. Here’s the error I’m seeing:
I think this issue is caused by the daily database cleanup cron job. Is there any solution for this?