~time-drive-devel/time-drive/time-drive.sync

« back to all changes in this revision

Viewing changes to timedrive/realtime.py

  • Committer: Rob Oakes
  • Date: 2012-11-22 15:44:51 UTC
  • Revision ID: rob.oakes@oak-tree.us-20121122154451-7qdlmnhqw2kq85jk
Fixed a bug which was causing local file checks to fail because of an overloaded database. If there is a rollback error while trying to check a local file record, it now returns a fail signal so that the operation is repeated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
                file_cdate, file_mdate = sync.getFileDates(file_localpath)
22
22
                try: md5_beg, md5_end = sync.checkMd5(file_localpath, sync.FILE_CHUNK)
23
23
                except: return sync_collection['Collection-Name'], sync.RT_FAIL, file_localpath
24
 
                dbfile_ = sync.getLocalFileRecord(file_localpath, db_session)
 
24
                
 
25
                # Retrieve the database for the local file
 
26
                try: dbfile_ = sync.getLocalFileRecord(file_localpath, db_session)
 
27
                except: return sync_collection['Collection-Name'], sync.RT_FAIL, file_localpath
25
28
 
26
29
                # New files not yet in the database
27
30
                if (dbfile_ == None):
245
248
                # Record of upload missing
246
249
                elif (dbfile_ is None) & (rdfile_ is not None):
247
250
 
248
 
                        print dbfile_, rdfile_, file_mdate
249
 
                        print rdfile_.__dict__
250
 
 
251
251
                        # Check against local file, add to database
252
252
                        result_, conflict_filepath = sync.mergeExistingFile(
253
253
                                file_localpath, # Local path