Skip to content

Commit 3e97ecc

Browse files
committed
moving around consolidation
1 parent 5259955 commit 3e97ecc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/silvimetric/commands/shatter.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,19 @@ def kill_gracefully(signum, frame):
194194

195195
## If dask is distributed, use the futures feature
196196
dc = get_client()
197+
consolidate_count = 1000
198+
count = 0
197199
if dc is not None:
198200
pc_futures = futures_of(processes.persist())
199201
for batch in as_completed(pc_futures, with_results=True).batches():
200-
storage.consolidate_shatter(config.timestamp)
201202
for _, pack in batch:
202203
if isinstance(pack, CancelledError):
203204
continue
204205
for pc in pack:
206+
count += 1
207+
if count >= consolidate_count:
208+
storage.consolidate_shatter(config.timestamp)
209+
count = 0
205210
config.point_count = config.point_count + pc
206211
del pc
207212

0 commit comments

Comments
 (0)