diff --git a/pyproject.toml b/pyproject.toml index 5fa4413..cc99795 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "rda_python_common" -version = "2.0.10" +version = "2.0.12" authors = [ { name="Zaihua Ji", email="zji@ucar.edu" }, ] diff --git a/src/rda_python_common/PgDBI.py b/src/rda_python_common/PgDBI.py index ca02492..0bb7bf7 100644 --- a/src/rda_python_common/PgDBI.py +++ b/src/rda_python_common/PgDBI.py @@ -468,6 +468,8 @@ def check_dberror(pgerr, pgcnt, sqlstr, ary, logact = PGDBI['ERRLOG']): if logact&PgLOG.DOLOCK and pgcode and re.match(r'^55\w\w\w$', pgcode): logact &= ~PgLOG.EXITLG # no exit for lock error + elif pgcnt > PgLOG.PGLOG['DBRETRY']: + logact |= PgLOG.EXITLG # exit for error count exceeds limit return qelog(dberror, 0, sqlstr, ary, pgcnt, logact) # diff --git a/src/rda_python_common/pg_dbi.py b/src/rda_python_common/pg_dbi.py index ccec395..4080e97 100644 --- a/src/rda_python_common/pg_dbi.py +++ b/src/rda_python_common/pg_dbi.py @@ -366,6 +366,8 @@ def check_dberror(self, pgerr, pgcnt, sqlstr, ary, logact = None): return self.SUCCESS if logact&self.DOLOCK and pgcode and re.match(r'^55\w\w\w$', pgcode): logact &= ~self.EXITLG # no exit for lock error + elif pgcnt > self.PGLOG['DBRETRY']: + logact |= self.EXITLG # exit for error count exceeds limit return self.qelog(dberror, 0, sqlstr, ary, pgcnt, logact) # return hash reference to postgresql batch mode command and output file name diff --git a/src/rda_python_common/pg_opt.py b/src/rda_python_common/pg_opt.py index e606a4a..d001a34 100644 --- a/src/rda_python_common/pg_opt.py +++ b/src/rda_python_common/pg_opt.py @@ -1435,7 +1435,7 @@ def send_request_email_notice(self, pgrqst, errmsg, fcount, rstat, readyfile = N rf.write(ebuf) rf.close() self.set_local_mode(readyfile, 1, self.PGLOG['FILEMODE']) - return rstat + return rstat # cache partition process error to existing email buffer def cache_partition_email_error(self, ridx, errmsg):