@@ -206,7 +206,7 @@ def make_hash(self, task):
206
206
hashedsum = hashlib .md5 (x ).hexdigest ()
207
207
return hashedsum
208
208
209
- def check_memo (self , task_id , task ):
209
+ def check_memo (self , task ):
210
210
"""Create a hash of the task and its inputs and check the lookup table for this hash.
211
211
212
212
If present, the results are returned. The result is a tuple indicating whether a memo
@@ -221,6 +221,9 @@ def check_memo(self, task_id, task):
221
221
222
222
This call will also set task['hashsum'] to the unique hashsum for the func+inputs.
223
223
"""
224
+
225
+ task_id = task ['id' ]
226
+
224
227
if not self .memoize or not task ['memoize' ]:
225
228
task ['hashsum' ] = None
226
229
logger .debug ("Task {} will not be memoized" .format (task_id ))
@@ -254,11 +257,10 @@ def hash_lookup(self, hashsum):
254
257
"""
255
258
return self .memo_lookup_table [hashsum ]
256
259
257
- def update_memo (self , task_id , task , r ):
260
+ def update_memo (self , task , r ):
258
261
"""Updates the memoization lookup table with the result from a task.
259
262
260
263
Args:
261
- - task_id (int): Integer task id
262
264
- task (dict) : A task dict from dfk.tasks
263
265
- r (Result future): Result future
264
266
@@ -267,6 +269,9 @@ def update_memo(self, task_id, task, r):
267
269
"""
268
270
# TODO: could use typeguard
269
271
assert isinstance (r , Future )
272
+
273
+ task_id = task ['id' ]
274
+
270
275
if not self .memoize or not task ['memoize' ] or 'hashsum' not in task :
271
276
return
272
277
0 commit comments