Correct first target state filename
This commit is contained in:
parent
43249a9ec0
commit
2b5383e9e0
@ -236,9 +236,9 @@ class SyncFsStore:
|
|||||||
self.item_keys.append(block_number)
|
self.item_keys.append(block_number)
|
||||||
logg.info('added existing {}'.format(o))
|
logg.info('added existing {}'.format(o))
|
||||||
|
|
||||||
fp = os.path.join(self.session_path, str(target))
|
fp = os.path.join(self.session_path, 'target')
|
||||||
if len(thresholds) == 0:
|
if len(thresholds) == 0:
|
||||||
logg.info('syncer first run')
|
logg.info('syncer first run target {}'.format(target))
|
||||||
self.first = True
|
self.first = True
|
||||||
f = open(fp, 'w')
|
f = open(fp, 'w')
|
||||||
f.write(str(target))
|
f.write(str(target))
|
||||||
|
@ -203,5 +203,20 @@ class TestFs(unittest.TestCase):
|
|||||||
o = store.get(2)
|
o = store.get(2)
|
||||||
|
|
||||||
|
|
||||||
|
def test_sync_history_interrupted(self):
|
||||||
|
store = SyncFsStore(self.path, session_id='foo')
|
||||||
|
session = SyncSession(store)
|
||||||
|
|
||||||
|
session.start(target=13)
|
||||||
|
o = session.get(0)
|
||||||
|
o.next(advance_block=True)
|
||||||
|
o.next(advance_block=True)
|
||||||
|
session.stop(o)
|
||||||
|
|
||||||
|
store = SyncFsStore(self.path, session_id='foo')
|
||||||
|
store.start()
|
||||||
|
o = store.get(0)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Loading…
Reference in New Issue
Block a user