Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make watchdog working with jedis pool #5

Merged
merged 2 commits into from
Sep 6, 2017
Merged

Conversation

dvizelman
Copy link

No description provided.

jedis.evalsha(watchdogScriptHash.get(), WATCHDOG_SCRIPT_KEYS_NUMBER, serverName, REQUEUE_JOBS, isDebug);
return null;
});
break;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bad practice.. using break to get out of a loop.
This makes code less readable as you have multiple exit point from the loop to look at...

int requeueJobsRetryNum = 0;


while (requeueJobsRetryNum <= REQUEUE_JOBS_RETRY_NUM) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the retry here?
Let's define the pool that will check the connection before borrow. It's less critical here as this code is running only when a server is going down.

@dvizelman dvizelman merged commit 9a26725 into master Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants