@@ -6,7 +6,7 @@ def __init__(self, get_conn, namespace=None):
66 self .get_conn = get_conn
77 self .namespace = namespace
88
9- async def reconcile (self , key , * , owner_id , fencing_token ):
9+ async def reconcile (self , key ):
1010 conn = await self .get_conn ()
1111
1212 try :
@@ -17,12 +17,10 @@ async def reconcile(self, key, *, owner_id, fencing_token):
1717 status = 'reconciling',
1818 lease_updated_at = NOW()
1919 WHERE key = %s
20- AND owner_id = %s
21- AND fencing_token = %s
2220 AND status = 'executing'
2321 AND lease_expires_at < NOW()
2422 RETURNING 1;
25- """ , (key , owner_id , fencing_token ))
23+ """ , (key ,))
2624
2725 success = await cur .fetchone () is not None
2826
@@ -33,14 +31,7 @@ async def reconcile(self, key, *, owner_id, fencing_token):
3331 finally :
3432 await conn .close ()
3533
36- async def force_complete (
37- self ,
38- key ,
39- * ,
40- owner_id ,
41- fencing_token ,
42- execution_result
43- ):
34+ async def force_complete (self , key , execution_result ):
4435 conn = await self .get_conn ()
4536
4637 try :
@@ -52,16 +43,9 @@ async def force_complete(
5243 execution_result = %s,
5344 lease_updated_at = NOW()
5445 WHERE key = %s
55- AND owner_id = %s
56- AND fencing_token = %s
5746 AND status = 'reconciling'
5847 RETURNING 1;
59- """ , (
60- execution_result ,
61- key ,
62- owner_id ,
63- fencing_token
64- ))
48+ """ , (execution_result , key ))
6549
6650 success = await cur .fetchone () is not None
6751
@@ -72,13 +56,7 @@ async def force_complete(
7256 finally :
7357 await conn .close ()
7458
75- async def reset (
76- self ,
77- key ,
78- * ,
79- owner_id ,
80- fencing_token
81- ):
59+ async def reset (self , key ):
8260 conn = await self .get_conn ()
8361
8462 try :
@@ -89,15 +67,9 @@ async def reset(
8967 status = 'claimed',
9068 lease_updated_at = NOW()
9169 WHERE key = %s
92- AND owner_id = %s
93- AND fencing_token = %s
9470 AND status = 'reconciling'
9571 RETURNING 1;
96- """ , (
97- key ,
98- owner_id ,
99- fencing_token
100- ))
72+ """ , (key ,))
10173
10274 success = await cur .fetchone () is not None
10375
0 commit comments