Skip to content

Commit c1b7740

Browse files
akhileshhfcollman
authored andcommitted
handle key error and ignore message
1 parent 0f3b0c7 commit c1b7740

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

workers/mesh_worker.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,20 @@ def callback(payload):
2929
cg = ChunkedGraph(graph_id=table_id)
3030
PCG_CACHE[table_id] = cg
3131

32-
mesh_dir = cg.meta.dataset_info["mesh"]
33-
cv_unsharded_mesh_dir = cg.meta.dataset_info["mesh_metadata"]["unsharded_mesh_dir"]
32+
INFO_HIGH = 25
33+
logging.basicConfig(
34+
level=INFO_HIGH,
35+
format="%(asctime)s %(message)s",
36+
datefmt="%m/%d/%Y %I:%M:%S %p",
37+
)
38+
39+
try:
40+
mesh_dir = cg.meta.dataset_info["mesh"]
41+
cv_unsharded_mesh_dir = cg.meta.dataset_info["mesh_metadata"]["unsharded_mesh_dir"]
42+
except KeyError:
43+
logging.warning(f"No metadata found for {cg.graph_id}; ignoring...")
44+
return
45+
3446
mesh_path = path.join(
3547
cg.meta.data_source.WATERSHED, mesh_dir, cv_unsharded_mesh_dir
3648
)
@@ -43,12 +55,7 @@ def callback(payload):
4355
except KeyError:
4456
return
4557

46-
INFO_HIGH = 25
47-
logging.basicConfig(
48-
level=INFO_HIGH,
49-
format="%(asctime)s %(message)s",
50-
datefmt="%m/%d/%Y %I:%M:%S %p",
51-
)
58+
5259
logging.log(INFO_HIGH, f"remeshing {l2ids}; graph {table_id} operation {op_id}.")
5360
meshgen.remeshing(
5461
cg,

0 commit comments

Comments
 (0)