get_running_loop() -> get_event_loop()

This commit is contained in:
Lex Berezhny 2019-01-07 17:59:37 -05:00
parent 71a0c704bd
commit 2c84b7a7dd
2 changed files with 5 additions and 5 deletions

View file

@ -219,7 +219,7 @@ class SQLiteStorage(SQLiteMixin):
def should_single_announce_blobs(self, blob_hashes, immediate=False): def should_single_announce_blobs(self, blob_hashes, immediate=False):
def set_single_announce(transaction): def set_single_announce(transaction):
now = asyncio.get_running_loop().time() now = asyncio.get_event_loop().time()
for blob_hash in blob_hashes: for blob_hash in blob_hashes:
if immediate: if immediate:
transaction.execute( transaction.execute(
@ -234,7 +234,7 @@ class SQLiteStorage(SQLiteMixin):
def get_blobs_to_announce(self): def get_blobs_to_announce(self):
def get_and_update(transaction): def get_and_update(transaction):
timestamp = asyncio.get_running_loop().time() timestamp = asyncio.get_event_loop().time()
if conf.settings['announce_head_blobs_only']: if conf.settings['announce_head_blobs_only']:
r = transaction.execute( r = transaction.execute(
"select blob_hash from blob " "select blob_hash from blob "
@ -784,7 +784,7 @@ class SQLiteStorage(SQLiteMixin):
if success: if success:
return self.db.execute( return self.db.execute(
"insert or replace into reflected_stream values (?, ?, ?)", "insert or replace into reflected_stream values (?, ?, ?)",
(sd_hash, reflector_address, asyncio.get_running_loop().time()) (sd_hash, reflector_address, asyncio.get_event_loop().time())
) )
return self.db.execute( return self.db.execute(
"delete from reflected_stream where sd_hash=? and reflector_address=?", "delete from reflected_stream where sd_hash=? and reflector_address=?",
@ -796,7 +796,7 @@ class SQLiteStorage(SQLiteMixin):
"select s.sd_hash from stream s " "select s.sd_hash from stream s "
"left outer join reflected_stream r on s.sd_hash=r.sd_hash " "left outer join reflected_stream r on s.sd_hash=r.sd_hash "
"where r.timestamp is null or r.timestamp < ?", "where r.timestamp is null or r.timestamp < ?",
asyncio.get_running_loop().time() - conf.settings['auto_re_reflect_interval'] asyncio.get_event_loop().time() - conf.settings['auto_re_reflect_interval']
) )

View file

@ -71,7 +71,7 @@ class DiskBlobManager:
def set_should_announce(self, blob_hash, should_announce): def set_should_announce(self, blob_hash, should_announce):
return f2d(self.storage.set_should_announce( return f2d(self.storage.set_should_announce(
blob_hash, asyncio.get_running_loop().time(), should_announce blob_hash, asyncio.get_event_loop().time(), should_announce
)) ))
def get_should_announce(self, blob_hash): def get_should_announce(self, blob_hash):