account for the number of variables on each iteration
This commit is contained in:
parent
76d0e31544
commit
350eec35ee
1 changed files with 3 additions and 2 deletions
|
@ -60,7 +60,8 @@ def get_all_addresses(self):
|
|||
|
||||
def add_keys(pubkeys):
|
||||
c = context()
|
||||
for start in range(0, len(pubkeys), c.variable_limit - 1):
|
||||
batch = pubkeys[start:(start + c.variable_limit - 1)]
|
||||
current_limit = c.variable_limit // len(pubkeys[0]) # (overall limit) // (maximum on a query)
|
||||
for start in range(0, len(pubkeys), current_limit - 1):
|
||||
batch = pubkeys[start:(start + current_limit - 1)]
|
||||
c.execute(c.insert_or_ignore(PubkeyAddress).values([{'address': k['address']} for k in batch]))
|
||||
c.execute(c.insert_or_ignore(AccountAddress).values(batch))
|
||||
|
|
Loading…
Add table
Reference in a new issue