Changeset 7 for trunk


Ignore:
Timestamp:
Oct 31, 2013, 8:54:08 AM (6 years ago)
Author:
rob.hooft@…
Message:

some timing issues, and fix for different pmid_versions of same article

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/id-mapper/pmid2doi-mapper.py

    r6 r7  
    9494    now = datetime.datetime.now()
    9595    sys.stderr.write("%s: %s\n" % (now, message))
     96    sys.stderr.flush()
    9697
    9798
     
    223224                    self.cursor.execute(sqldelete)
    224225            except:
     226                print "ERROR: Got exception on moving the match"
    225227                self.connection.rollback()
    226228                raise
     
    243245
    244246    def tryAgainInAFewHours(self, pmid):
    245         """ Mark the record with the given pubmed id as tried, but only for a few hours and do not raise the try counter."""
     247        """ Mark the record with the given pubmed id as tried, but only for a day and do not raise the try counter."""
    246248        sql = """UPDATE %s SET
    247                  nexttrytime=(TO_SECONDS(NOW())+10800)
     249                 nexttrytime=(TO_SECONDS(NOW())+86400)
    248250                 WHERE pmid="%s";""" % (inputTable, pmid)
    249251        self.cursor.execute(sql)
     
    292294            u = urllib2.urlopen(URL + params, data=None, timeout=20)
    293295        except httplib.BadStatusLine:
    294             logerr("httplib.BadStatusLine")
     296            logerr("httplib.BadStatusLine params="+params)
    295297        except urllib2.HTTPError:
    296             logerr("urllib2.HTTPError")
     298            logerr("urllib2.HTTPError params="+params)
    297299        except urllib2.URLError:
    298             logerr("urllib2.URLError")
     300            logerr("urllib2.URLError params="+params)
    299301        else:
    300302            break
     
    341343         FROM   %(medlineDB)s.medline_citation c
    342344         WHERE  c.pmid not in (SELECT pmid from %(outputTable)s)
     345         AND    c.pmid_version=1
    343346         AND    c.pmid not in (SELECT pmid from %(inputTable)s));
    344347        """ % {"inputTable": inputTable,
Note: See TracChangeset for help on using the changeset viewer.