-
Notifications
You must be signed in to change notification settings - Fork 131
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
add runAt property to job #146
Conversation
f21a108
to
cb31baf
Compare
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please only use explicit imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
class JobPayload { | ||
String element; | ||
Double score; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These properties can both be final since they're only written to in the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was able to get rid of this, as per your other suggestion
* | ||
* @param jedis | ||
* @param queueName | ||
* @param jobOffset | ||
* @param jobCount | ||
* @return | ||
*/ | ||
private Collection<String> paylods(final Jedis jedis, final String queueName, final long jobOffset, final long jobCount) { | ||
private Collection<JobPayload> getJobPayloads(final Jedis jedis, final String queueName, final long jobOffset, final long jobCount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this method just returned Collection<Job>
? Since you're iterating over the elements here, might as well create the Job instead of an intermediary JobPayload object. Will simplify getQueueInfo() quite a bit, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah totally makes sense and results in less code. thanks!
Thanks for the quality PR! Just a few thoughts on restructuring a bit. |
cb31baf
to
6b3ef87
Compare
This patch adds a
runAt
property to theJob
class.The property is set by
QueueInfoDAORedisImpl#getQueueInfo
, but only when the queue is a delayed one.The property is exposed via
QueueInfo.getJobs()*.runAt
.