Skip to content

Commit

Permalink
fixed service context so that it is never null for queue callbacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Hightower committed Jul 10, 2015
1 parent 57d2dc2 commit 0bd07a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private void check() {
if (duration > checkInIntervalMS) {
lastCheckTime = now;

ServiceQueue serviceQueue = ServiceContext.serviceContext().currentService();
final ServiceQueue serviceQueue = ServiceContext.serviceContext().currentService();

boolean failing = serviceQueue.failing();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ public void init() {
serviceThreadLocal.set(BaseServiceQueueImpl.this);
queueCallBackHandler.queueInit();
serviceMethodHandler.init();
serviceThreadLocal.set(null);
}

@Override
Expand Down Expand Up @@ -447,6 +446,8 @@ public void shutdown() {

@Override
public void idle() {

serviceThreadLocal.set(BaseServiceQueueImpl.this);
handle();
serviceMethodHandler.idle();
queueCallBackHandler.queueIdle();
Expand Down

0 comments on commit 0bd07a1

Please sign in to comment.