Skip to content
Browse files

Broaden the scope of this try block.

  • Loading branch information...
1 parent bf2ad0d commit a8cbb69908223fc7f83c84f6b399cc616750475f @ralphbean ralphbean committed Feb 18, 2014
Showing with 13 additions and 12 deletions.
  1. 0 downloads/.placeholder
  2. +13 −12 summershum/core.py
View
0 downloads/.placeholder
No changes.
View
25 summershum/core.py
@@ -7,21 +7,22 @@
def ingest(session, msg, config, force=False):
- found = summershum.model.File.by_tar_sum(session, msg['md5sum'])
- if found and not force:
- log.info("Skipping %r, sum found in the db" % msg.get('filename'))
- return
+ try:
+ found = summershum.model.File.by_tar_sum(session, msg['md5sum'])
+
+ if found and not force:
+ log.info("Skipping %r, sum found in the db" % msg.get('filename'))
+ return
- log.info("Ingesting %r" % msg.get('filename'))
- fedmsg.publish(
- topic='ingest.start',
- msg=dict(original=msg),
- )
+ log.info("Ingesting %r" % msg.get('filename'))
+ fedmsg.publish(
+ topic='ingest.start',
+ msg=dict(original=msg),
+ )
- lookaside_url = config['summershum.lookaside']
- tmpdir = config['summershum.tmpdir']
+ lookaside_url = config['summershum.lookaside']
+ tmpdir = config['summershum.tmpdir']
- try:
summershum.utils.download_lookaside(msg, lookaside_url, tmpdir)
summershum.utils.calculate_sums(session, msg, tmpdir)
except Exception as e:

0 comments on commit a8cbb69

Please sign in to comment.
Something went wrong with that request. Please try again.