Put a bandaid on the save_load duplicate issue

Ref #22171
This commit is contained in:
Colton Myers 2015-03-31 11:11:28 -06:00
parent 21515f3c23
commit 0127012ed3

View file

@ -171,7 +171,13 @@ def save_load(jid, load):
(`jid`, `load`)
VALUES (%s, %s)'''
cur.execute(sql, (jid, json.dumps(load)))
try:
cur.execute(sql, (jid, json.dumps(load)))
except MySQLdb.IntegrityError:
# https://github.com/saltstack/salt/issues/22171
# Without this try:except: we get tons of duplicate entry errors
# which result in job returns not being stored properly
pass
def get_load(jid):