Skip to content

Commit

Permalink
fix for estimates when backup folder doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jay0lee committed Jan 15, 2016
1 parent 1e5cef2 commit a53b052
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@ def main(argv):
#Determine which messages from the search we haven't processed before.
print("GYB needs to examine %s messages" % len(messages_to_process))
for message_num in messages_to_process:
if not newDB and message_is_backed_up(message_num['id'], sqlcur,
if not newDB and os.path.isfile(sqldbfile) and message_is_backed_up(message_num['id'], sqlcur,
sqlconn, options.local_folder):
pass
else:
Expand All @@ -1487,13 +1487,11 @@ def main(argv):
if len(gbatch._order) == options.batch_size:
callGAPI(gbatch, None)
gbatch = googleapiclient.http.BatchHttpRequest()
sqlconn.commit()
rewrite_line("Estimated size %s %s/%s messages" %
(bytes_to_larger(message_size_estimate), estimated_messages,
estimate_count))
if len(gbatch._order) > 0:
callGAPI(gbatch, None)
sqlconn.commit()
rewrite_line("Estimated size %s %s/%s messages" %
(bytes_to_larger(message_size_estimate), estimated_messages,
estimate_count))
Expand Down

0 comments on commit a53b052

Please sign in to comment.