Skip to content

Instantly share code, notes, and snippets.

@Slach
Created July 24, 2017 13:09
Show Gist options
  • Save Slach/017f12e8a9663f2d587f864e819f9726 to your computer and use it in GitHub Desktop.
Save Slach/017f12e8a9663f2d587f864e819f9726 to your computer and use it in GitHub Desktop.
Fix Mamonsu too big replication lag over update mamonsu table every second
SHELL=/bin/bash
* * * * * postgres /usr/bin/flock -x -w 60 /tmp/mamonsu_fix.lock -c "for i in {0..59}; do psql -q -A -t -c \"SELECT 1 FROM public.mamonsu_timestamp_master_update()\" > /dev/null; sleep 1; done;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment