diff options
| author | Marko Kreen | 2009-04-30 09:06:11 +0000 |
|---|---|---|
| committer | Marko Kreen | 2009-04-30 09:06:11 +0000 |
| commit | 2ffefdae51e8acb66c03afad38bcac3ecbb23d4e (patch) | |
| tree | fb04bb11ba961059a9640f1b1b068945577e4d73 | |
| parent | 54b28705153b60793e1e673040acb0b67680d41d (diff) | |
londiste: cmd_execute() did not check ret_code of londiste.execute_start()
Also unify checking in both places - dont depend on exactly
'200' code from there.
| -rw-r--r-- | python/londiste/playback.py | 3 | ||||
| -rw-r--r-- | python/londiste/setup.py | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/python/londiste/playback.py b/python/londiste/playback.py index d6a6b668..5618da4a 100644 --- a/python/londiste/playback.py +++ b/python/londiste/playback.py @@ -528,7 +528,8 @@ class Replicator(CascadedWorker): q = "select * from londiste.execute_start(%s, %s, %s, false)" res = self.exec_cmd(dst_curs, q, [self.queue_name, fname, sql], commit = False) ret = res[0]['ret_code'] - if ret != 200: + if ret >= 300: + self.log.warning("Skipping execution of '%s'", fname) return for stmt in skytools.parse_statements(sql): dst_curs.execute(stmt) diff --git a/python/londiste/setup.py b/python/londiste/setup.py index efc14ea8..61f226fe 100644 --- a/python/londiste/setup.py +++ b/python/londiste/setup.py @@ -308,7 +308,11 @@ class LondisteSetup(CascadeAdmin): fname = os.path.basename(fn) sql = open(fn, "r").read() q = "select * from londiste.execute_start(%s, %s, %s, true)" - self.exec_cmd(db, q, [self.queue_name, fname, sql], commit = False) + res = self.exec_cmd(db, q, [self.queue_name, fname, sql], commit = False) + ret = res[0]['ret_code'] + if ret >= 300: + self.log.warning("Skipping execution of '%s'" % fname) + continue for stmt in skytools.parse_statements(sql): curs.execute(stmt) q = "select * from londiste.execute_finish(%s, %s)" |
