Skip to content

Commit 0811677

Browse files
committed
make new clients each time get_tiled_client() is called
* the underlying object is not async-compatible so make a new client every time one is requested instead of sharing
1 parent dbd40ee commit 0811677

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55

66
LOCATION="tst"
77

8-
os.environ["TILED_API_KEY"] = Secret.load(f"tiled-{LOCATION}-api-key").get()
9-
tiled_client = from_profile("nsls2")[LOCATION]["raw"]
10-
os.environ.pop("TILED_API_KEY")
11-
128
def get_tiled_client():
9+
os.environ["TILED_API_KEY"] = Secret.load(f"tiled-{LOCATION}-api-key").get()
10+
tiled_client = from_profile("nsls2")[LOCATION]["raw"]
11+
os.environ.pop("TILED_API_KEY")
1312
return tiled_client

0 commit comments

Comments
 (0)