@@ -224,15 +224,15 @@ async def set_destination_retry_timings(
224
224
225
225
await self .db_pool .runInteraction (
226
226
"set_destination_retry_timings" ,
227
- self ._set_destination_retry_timings_native ,
227
+ self ._set_destination_retry_timings_txn ,
228
228
destination ,
229
229
failure_ts ,
230
230
retry_last_ts ,
231
231
retry_interval ,
232
232
db_autocommit = True , # Safe as it's a single upsert
233
233
)
234
234
235
- def _set_destination_retry_timings_native (
235
+ def _set_destination_retry_timings_txn (
236
236
self ,
237
237
txn : LoggingTransaction ,
238
238
destination : str ,
@@ -266,58 +266,6 @@ def _set_destination_retry_timings_native(
266
266
txn , self .get_destination_retry_timings , (destination ,)
267
267
)
268
268
269
- def _set_destination_retry_timings_emulated (
270
- self ,
271
- txn : LoggingTransaction ,
272
- destination : str ,
273
- failure_ts : Optional [int ],
274
- retry_last_ts : int ,
275
- retry_interval : int ,
276
- ) -> None :
277
- self .database_engine .lock_table (txn , "destinations" )
278
-
279
- # We need to be careful here as the data may have changed from under us
280
- # due to a worker setting the timings.
281
-
282
- prev_row = self .db_pool .simple_select_one_txn (
283
- txn ,
284
- table = "destinations" ,
285
- keyvalues = {"destination" : destination },
286
- retcols = ("failure_ts" , "retry_last_ts" , "retry_interval" ),
287
- allow_none = True ,
288
- )
289
-
290
- if not prev_row :
291
- self .db_pool .simple_insert_txn (
292
- txn ,
293
- table = "destinations" ,
294
- values = {
295
- "destination" : destination ,
296
- "failure_ts" : failure_ts ,
297
- "retry_last_ts" : retry_last_ts ,
298
- "retry_interval" : retry_interval ,
299
- },
300
- )
301
- elif (
302
- retry_interval == 0
303
- or prev_row ["retry_interval" ] is None
304
- or prev_row ["retry_interval" ] < retry_interval
305
- ):
306
- self .db_pool .simple_update_one_txn (
307
- txn ,
308
- "destinations" ,
309
- keyvalues = {"destination" : destination },
310
- updatevalues = {
311
- "failure_ts" : failure_ts ,
312
- "retry_last_ts" : retry_last_ts ,
313
- "retry_interval" : retry_interval ,
314
- },
315
- )
316
-
317
- self ._invalidate_cache_and_stream (
318
- txn , self .get_destination_retry_timings , (destination ,)
319
- )
320
-
321
269
async def store_destination_rooms_entries (
322
270
self ,
323
271
destinations : Iterable [str ],
0 commit comments