if(db.query("select group_concat(distinct agentId) from QUEUE where agentId is not null and statusId=5 and timestampdiff(SECOND,mtime,now())>=ifnull(remoteTimeout,43200)")
db.query("select group_concat(distinct agentId) from QUEUE where agentId is not null and statusId=5 and timestampdiff(SECOND,mtime,now())>=ifnull(remoteTimeout,43200)");
finalStringagents=db.gets(1);
finalStringagents=getRemoteAgents();
if(agents!=null&&!agents.isBlank()){
where+=" and entryId in ("+agents+")";
...
...
@@ -536,7 +557,7 @@ public class JobBroker {
db.setReadOnly(true);
finalStringq="select "+ret+" from JOBAGENT where 1=1 "+where+" order by priority desc, price desc, oldestQueueId asc limit 1";
finalStringq="select "+ret+" from JOBAGENT where counter>0 "+where+" order by priority desc, price desc, oldestQueueId asc limit 1";
if(logger.isLoggable(Level.FINE)){
logger.log(Level.FINE,"Going to select agents ("+q+")");