@@ -63,7 +63,7 @@ async def interoperability_production_create(name: str, ctx: Context) -> bool:
63
63
raise ValueError (
64
64
"Production name must in format packagenamespace.productionname, where packagenamespace can have multiple parts separated by dots"
65
65
)
66
- iris = ctx .request_context . lifespan_context [ " iris" ]
66
+ iris = ctx .iris
67
67
with transaction (iris ):
68
68
prod = iris .classMethodObject (
69
69
"%Dictionary.ClassDefinition" , "%OpenId" , name
@@ -86,7 +86,7 @@ async def interoperability_production_status(
86
86
full_status : bool = False ,
87
87
) -> str :
88
88
logger .info ("Interoperability Production Status" + f": { name } " if name else "" )
89
- iris = ctx .request_context . lifespan_context [ " iris" ]
89
+ iris = ctx .iris
90
90
refname = IRISReference (iris )
91
91
refname .setValue (name )
92
92
refstatus = IRISReference (iris )
@@ -123,7 +123,7 @@ async def interoperability_production_start(
123
123
logger .info (
124
124
"Starting Interoperability Production" + f": { name } " if name else "."
125
125
)
126
- iris = ctx .request_context . lifespan_context [ " iris" ]
126
+ iris = ctx .iris
127
127
raise_on_error (
128
128
iris ,
129
129
iris .classMethodString (
@@ -152,7 +152,7 @@ async def interoperability_production_stop(
152
152
force : bool = False ,
153
153
) -> str :
154
154
logger .info ("Sopping Interoperability Production." )
155
- iris = ctx .request_context . lifespan_context [ " iris" ]
155
+ iris = ctx .iris
156
156
raise_on_error (
157
157
iris ,
158
158
iris .classMethodString (
@@ -166,7 +166,7 @@ async def interoperability_production_recover(
166
166
ctx : Context ,
167
167
) -> str :
168
168
logger .info ("Recovering Interoperability Production" )
169
- iris = ctx .request_context . lifespan_context [ " iris" ]
169
+ iris = ctx .iris
170
170
raise_on_error (
171
171
iris , iris .classMethodString ("Ens.Director" , "RecoverProduction" )
172
172
)
@@ -177,7 +177,7 @@ async def interoperability_production_needsupdate(
177
177
ctx : Context ,
178
178
) -> str :
179
179
logger .info ("Checking if Interoperability Production needs update" )
180
- iris = ctx .request_context . lifespan_context [ " iris" ]
180
+ iris = ctx .iris
181
181
reason = IRISReference (iris )
182
182
result = iris .classMethodBoolean (
183
183
"Ens.Director" , "ProductionNeedsUpdate" , reason
@@ -192,7 +192,7 @@ async def interoperability_production_update(
192
192
timeout : int = None ,
193
193
force : bool = False ,
194
194
) -> str :
195
- iris = ctx .request_context . lifespan_context [ " iris" ]
195
+ iris = ctx .iris
196
196
raise_on_error (
197
197
iris ,
198
198
iris .classMethodString ("Ens.Director" , "UpdateProduction" , timeout , force ),
@@ -215,7 +215,7 @@ async def interoperability_production_logs(
215
215
log_type_alert and log_type .append (LogType .Alert .value )
216
216
log_type_error and log_type .append (LogType .Error .value )
217
217
log_type_warning and log_type .append (LogType .Warning .value )
218
- db = ctx .request_context . lifespan_context [ "db" ]
218
+ db = ctx .db
219
219
with db .cursor () as cur :
220
220
sql = f"""
221
221
select top ? TimeLogged , %External(Type) Type, ConfigName, Text
@@ -236,7 +236,7 @@ async def interoperability_production_queues(
236
236
ctx : Context ,
237
237
) -> str :
238
238
queues = []
239
- db = ctx .request_context . lifespan_context [ "db" ]
239
+ db = ctx .db
240
240
with db .cursor () as cur :
241
241
sql = "select * from Ens.Queue_Enumerate()"
242
242
cur .execute (sql )
0 commit comments