انتقل إلى المحتوى
#0905
SqliteCronNotifications

Forty branch databases certify themselves every night

02:00. A cron entry loops over forty store containers and POSTs /api/v1/sqlite/maintenance?db=pos.db with {"op": "quick_check"}. Each database answers with a result field. ok means the file is structurally sound. Anything else, and the store number goes into one notification on the ops display before the first cashier arrives. The same loop runs wal_checkpoint_truncate afterward, so the write-ahead log doesn't grow unattended in a store nobody visits.

The check runs on the database connection itself, fenced from the queries the POS is making at the same time. No agent installed in the store, no monitoring vendor, no SSH.

Database health used to be discovered by the branch that couldn't open the till. Now forty files report their own integrity, on a schedule, to one screen.

The integrity check is a POST, and 'ok' is the whole report.