|
28 | 28 | (provide job-path |
29 | 29 | job-start |
30 | 30 | job-status |
| 31 | + job-forget |
31 | 32 | job-wait |
32 | 33 | job-results |
33 | 34 | job-timeline |
|
154 | 155 | (log "Checking on: ~a.\n" job-id) |
155 | 156 | (manager-ask 'check job-id)) |
156 | 157 |
|
| 158 | +(define (job-forget job-id) |
| 159 | + (log "Forgetting job: ~a.\n" job-id) |
| 160 | + (manager-ask 'forget job-id)) |
| 161 | + |
157 | 162 | (define (job-wait job-id) |
158 | 163 | (define finished-result (manager-ask 'wait manager job-id)) |
159 | 164 | (log "Done waiting for: ~a\n" job-id) |
|
245 | 250 | [(list 'improve) |
246 | 251 | (for/list ([(job-id result) (in-hash completed-jobs)] |
247 | 252 | #:when (equal? (hash-ref result 'command) "improve")) |
248 | | - result)])) |
| 253 | + result)] |
| 254 | + [(list 'forget job-id) |
| 255 | + (hash-remove! completed-jobs job-id) |
| 256 | + (void)])) |
249 | 257 |
|
250 | 258 | ;; Implementation of threaded manager |
251 | 259 |
|
|
369 | 377 | (define total (+ (hash-count busy-workers) (hash-count queued-jobs))) |
370 | 378 | (log "Currently ~a jobs total.\n" total) |
371 | 379 | (place-channel-put handler total)] |
372 | | - ; Retreive the improve results for results.json |
| 380 | + ; Retrieve the improve results for results.json |
373 | 381 | [(list 'improve handler) |
374 | 382 | (define improved-list |
375 | 383 | (for/list ([(job-id result) (in-hash completed-jobs)] |
376 | 384 | #:when (equal? (hash-ref result 'command) "improve")) |
377 | 385 | result)) |
378 | | - (place-channel-put handler improved-list)])))) |
| 386 | + (place-channel-put handler improved-list)] |
| 387 | + ; Forget a completed job result |
| 388 | + [(list 'forget handler job-id) |
| 389 | + (hash-remove! completed-jobs job-id) |
| 390 | + (place-channel-put handler (void))])))) |
379 | 391 |
|
380 | 392 | ;; Implementation of threaded worker |
381 | 393 |
|
|
0 commit comments