Created
May 3, 2019 17:39
-
-
Save lolobosse/2060032aa66be03c1ac42772a993640b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t = Task(type='resize', arguments=json.dumps({'new_width': width, 'url': url, 'bucket': self.bucket})) | |
try: | |
db.session.add(t) | |
db.session.commit() | |
sys_log.info("Added the resize task to the DB") | |
except IntegrityError as integrityerror: | |
db.session.rollback() | |
sys_log.info("Task is conflicting with another task in the DB") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment