Skip to content

Commit

Permalink
Fix jobs:done/1 by sending pid of job owner
Browse files Browse the repository at this point in the history
Before this change, jobs that ran from the same process would never
be marked "done" because the cast for the done msg never matched.

Things would behave fine provided you spawned a new process for the
duration of the job - calling done/1 didn't do anything, only the
process monitor was correctly cleaning up finished jobs.
  • Loading branch information
RJ committed Nov 26, 2012
1 parent 0e3361d commit f82daa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jobs_server.erl
Expand Up @@ -114,7 +114,7 @@ run(Type, Fun) when is_function(Fun, 0) ->
-spec done(reg_obj()) -> ok.
%%
done(Opaque) ->
gen_server:cast(?MODULE, {done, Opaque}).
gen_server:cast(?MODULE, {done, self(), Opaque}).


-spec enqueue(job_class(), any()) -> ok.
Expand Down

0 comments on commit f82daa8

Please sign in to comment.