Skip to content

Commit

Permalink
dep: Switch from rolex to driftless
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhang committed Aug 10, 2018
1 parent fb681c1 commit 15dd507
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
7 changes: 3 additions & 4 deletions core/lib/phases.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const isUndefined = _.isUndefined;
const arrivals = require('arrivals');
const debug = require('debug')('phases');
const crypto = require('crypto');
const Rolex = require('rolex');
Rolex.noConflict();
const driftless = require('driftless');

module.exports = phaser;

Expand Down Expand Up @@ -110,7 +109,7 @@ function createRamp(spec, ee) {
let ticksElapsed = 0;

let i = 0;
const timer = Rolex.setInterval(function maybeArrival() {
const timer = driftless.setDriftlessInterval(function maybeArrival() {
let startedAt = Date.now();
if(++ticksElapsed > ticksPerPeriod) {
debug(`ticksElapsed: ${ticksElapsed}; upping probability or stopping`);
Expand All @@ -125,7 +124,7 @@ function createRamp(spec, ee) {
} else {
debug(`done: ticksElapsed = ${ticksElapsed}; currentRate = ${currentRate}; spec.rampTo = ${spec.rampTo} `);

Rolex.clearInterval(timer);
driftless.clearDriftless(timer);
ee.emit('phaseCompleted', spec);

/*
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"csv-parse": "^0.1.4",
"debug": "^2.2.0",
"deep-equal": "^1.0.1",
"driftless": "^2.0.3",
"esprima": "^4.0.0",
"filtrex": "^0.5.4",
"js-yaml": "^3.10.0",
Expand All @@ -60,7 +61,6 @@
"pidusage": "^1.1.6",
"rc": "^1.1.6",
"request": "^2.85.0",
"rolex": "^1.1.2",
"socket.io-client": "^2.1.0",
"socketio-wildcard": "^2.0.0",
"stats-lite": "^2.1.0",
Expand Down

0 comments on commit 15dd507

Please sign in to comment.