jovandeginste / workout-tracker

A workout tracking web application for personal use (or family, friends), geared towards running and other GPX-based activities
Other
945 stars 31 forks source link

Worker started every secondes #143

Closed DavidHenryThoreau closed 3 months ago

DavidHenryThoreau commented 4 months ago

I'm looking at docker logs workout-tracker -f

It's appears a worker starts every secondes, is that normal ?

"time":"2024-05-07T11:12:53.151237364+02:00","level":"INFO","msg":"Worker started...","app":"workout-tracker","version":"v0.14.2"
{"time":"2024-05-07T11:12:53.153765084+02:00","level":"INFO","msg":"Worker finished...","app":"workout-tracker","version":"v0.14.2","s
{"time":"2024-05-07T11:14:53.167323297+02:00","level":"INFO","msg":"Worker started...","app":"workout-tracker","version":"v0.14.2","
{"time":"2024-05-07T11:14:53.16989256+02:00","level":"INFO","msg":"Worker finished...","app":"workout-tracker","version":"v0.14.2",
jovandeginste commented 4 months ago

It seems from your logs to start every two minutes; you see a log line when it starts, and when it finishes.

... which is strange, because the code says it should sleep for one minute...

DavidHenryThoreau commented 4 months ago

Yes, every two minutes. Do you have documentation about that worker ?

jovandeginste commented 4 months ago

Not really; you mean what it is expected to do?

DavidHenryThoreau commented 4 months ago

It's strange that waits every two minutes, I mean it could be better to trigger an action if something is happened instead of watting every two minutes ?

jovandeginste commented 4 months ago

It checks if any user has an import directory (and then checks if something should be imported), and if any workouts should be re-parsed (for bulk operations which take too long to run live)