MCPcopy Create free account
hub / github.com/RocketMap/RocketMap / bulk_upsert

Function bulk_upsert

pogom/models.py:909–922  ·  view source on GitHub ↗
(cls, data)

Source from the content-addressed store, hash-verified

907
908
909def bulk_upsert(cls, data):
910 num_rows = len(data.values())
911 i = 0
912 step = 120
913
914 while i < num_rows:
915 log.debug('Inserting items %d to %d', i, min(i + step, num_rows))
916 try:
917 InsertQuery(cls, rows=data.values()[i:min(i + step, num_rows)]).upsert().execute()
918 except Exception as e:
919 log.warning('%s... Retrying', e)
920 continue
921
922 i += step
923
924
925def create_tables(db):

Callers 2

parse_gymsFunction · 0.85
db_updaterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected