The application should receive system SIGINT signal and start graceful shutdown process:
Unschedule cron jobs
~Close all workers (for example, gitlab puller worker has Close() method)~
~Wait for 15 seconds till current jobs are done (or check for cron jobs are done if possible)~
~Cancel all contexts~
~Close database connection~
~Log that app gracefully stopped~
For this purpose app-wide context declared in internal/pkg/app should be passed to all clients and repository constructors. And then is should be used as parent context for context.WithTimeout.
The application should receive system
SIGINT
signal and start graceful shutdown process:Close()
method)~For this purpose app-wide context declared in
internal/pkg/app
should be passed to all clients and repository constructors. And then is should be used as parent context forcontext.WithTimeout
.