File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ def importThread(
69
69
data (list): The list of tiles to download
70
70
db
71
71
"""
72
- log .debug (f"In importThread()" )
72
+ # log.debug(f"In importThread()")
73
73
#timer = Timer(text="importThread() took {seconds:.0f}s")
74
74
#timer.start()
75
75
ways = table (
@@ -89,9 +89,9 @@ def importThread(
89
89
)
90
90
91
91
index = 0
92
- log . debug ( f"DATA: { index } { len ( data ) } " )
92
+
93
93
for feature in data :
94
- log .debug (feature )
94
+ # log.debug(feature)
95
95
index -= 1
96
96
entry = dict ()
97
97
tags = feature ['properties' ]
@@ -304,6 +304,9 @@ def importGeoJson(
304
304
index = 0
305
305
connections = list ()
306
306
307
+ timer = Timer (text = "importGeoJson() took {seconds:.0f}s" )
308
+ timer .start ()
309
+
307
310
for thread in range (0 , cores + 1 ):
308
311
engine = create_engine (f"postgresql://{ self .dburi } " , echo = False )
309
312
if not database_exists (engine .url ):
@@ -321,6 +324,7 @@ def importGeoJson(
321
324
322
325
if entries <= chunk :
323
326
result = importThread (data ['features' ], connections [0 ])
327
+ timer .stop ()
324
328
return True
325
329
326
330
with concurrent .futures .ThreadPoolExecutor (max_workers = cores ) as executor :
@@ -331,6 +335,8 @@ def importGeoJson(
331
335
block += chunk
332
336
index += 1
333
337
executor .shutdown ()
338
+ timer .stop ()
339
+
334
340
return True
335
341
336
342
def main ():
You can’t perform that action at this time.
0 commit comments