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

job:undefined when prefix contain colon symbol #96

Open
vothanhkiet opened this issue Jun 4, 2017 · 5 comments
Open

job:undefined when prefix contain colon symbol #96

vothanhkiet opened this issue Jun 4, 2017 · 5 comments

Comments

@vothanhkiet
Copy link
Contributor

When validate expired key, we've already include the prefix, however, when extract the job unique ID, we assume that the expired key has only 3 or 4 parts, therefore, if the prefix contain additional colon symbol, _getJobUUID return undefined value

queue._jobExpiryKeyValidator = new RegExp('^' + queue.options.prefix + ':scheduler:(?!' + lockKey + ')');
  var uuid;

  var splits = key.split(':');

  //deduce job uuid from job expiry key
  //kue:scheduler:<jobExpirykey>
  if (splits.length === 3) {
    uuid = splits[2];
  }

  //deduce job uuid from job data key
  //kue:scheduler:data:<jobExpirykey>
  if (splits.length === 4) {
    uuid = splits[3];
  }

Solution: can we use the last part as UUID ?

  var splits = key.split(':');

  splits = _.filter(splits, function(o) { return o !== ''; });
  if(splits.length > 0){
    uuid = splits[splits.length - 1];
  }
lykmapipo added a commit that referenced this issue Jun 9, 2017
@lykmapipo
Copy link
Owner

@vothanhkiet I will appreciate PR.

lykmapipo added a commit that referenced this issue Jun 13, 2017
lykmapipo added a commit that referenced this issue Jun 13, 2017
@schmod
Copy link
Contributor

schmod commented Jun 27, 2017

why did we lock dependencies?

among other things, this locked us into a dangerously-broken version of Redlock (v2.1.1)

@samhunta
Copy link
Contributor

@schmod This may solve your problem - #101

@schmod
Copy link
Contributor

schmod commented Jun 29, 2017

indeed, it probably would! FWIW, I've had good luck with Redlock 3.0.0.

@samhunta
Copy link
Contributor

@schmod I've tried Redlock 3.0.0 with no luck, not sure why :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants