Permalink
Browse files

support node 0.8 CLUSTER_UNIQUE_ID.

  • Loading branch information...
1 parent a309e6d commit 8f9e2535623cebe2f80dfe4e35a59c93e13dffd5 @dylang committed Jun 6, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/shortid.js
View
4 lib/shortid.js
@@ -160,7 +160,9 @@ function decode(id) {
// use defaults
setSeed(options.seed);
setVersion(options.version);
-setWorker(process.env.NODE_WORKER_ID ? parseInt(process.env.NODE_WORKER_ID, 10) : options.worker);
+setWorker(process.env.CLUSTER_UNIQUE_ID ? parseInt(CLUSTER_UNIQUE_ID, 10)
+ : process.env.NODE_WORKER_ID ? parseInt(process.env.NODE_WORKER_ID, 10)
+ : options.worker);
module.exports = generate;
module.exports.generate = generate;

0 comments on commit 8f9e253

Please sign in to comment.