mirror of
https://github.com/r4sas/py-i2phosts
synced 2025-01-08 22:07:55 +00:00
py-i2phosts-fetcher: update last_success only after injector's run
This commit is contained in:
parent
999ad9577f
commit
50386d3f70
@ -100,9 +100,6 @@ for source in all_sources:
|
||||
if etag:
|
||||
log.debug('%s ETag: %s', source.name, etag)
|
||||
source.etag = etag
|
||||
# update last_success
|
||||
source.last_success = datetime.datetime.now()
|
||||
source.save()
|
||||
# form commnd-line for invoke injector
|
||||
log.info('adding hosts from: %s', source.name)
|
||||
sp_args = ['py-i2phosts-injector', '-s', '-a', '-f', tmpfile, '-d',
|
||||
@ -112,3 +109,6 @@ for source in all_sources:
|
||||
out = p.communicate()[0]
|
||||
os.remove(tmpfile)
|
||||
log.info('injector output: \n%s', out)
|
||||
# update last_success
|
||||
source.last_success = datetime.datetime.now()
|
||||
source.save()
|
||||
|
Loading…
Reference in New Issue
Block a user