Skip to content

Instantly share code, notes, and snippets.

@lalinsky
Created January 11, 2013 00:34
Show Gist options
  • Save lalinsky/4507008 to your computer and use it in GitHub Desktop.
Save lalinsky/4507008 to your computer and use it in GitHub Desktop.
diff --git a/mbslave-sync.py b/mbslave-sync.py
index 7b1fdfa..2c44285 100755
--- a/mbslave-sync.py
+++ b/mbslave-sync.py
@@ -172,6 +172,7 @@ status = StatusReport(schema_seq, replication_seq)
if config.monitoring.enabled:
status.load(config.monitoring.status_file)
+num_packets = 0
while True:
replication_seq += 1
hook = hook_class(config, db, config)
@@ -183,7 +184,11 @@ while True:
process_tar(tmp, db, config, ignored_tables, schema_seq, replication_seq, hook)
tmp.close()
status.update(replication_seq)
+ num_packets += 1
if config.monitoring.enabled:
status.save(config.monitoring.status_file)
+if not num_packets:
+ sys.exit(1)
+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment