Skip to content

Commit 0051191

Browse files
authored
fix: remove lodash.once dep (#190)
1 parent c74febb commit 0051191

File tree

4 files changed

+12551
-233
lines changed

4 files changed

+12551
-233
lines changed

index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
// our debug log messages
66
const debug = require('debug')('xvfb')
7-
const once = require('lodash.once')
87
const fs = require('fs')
98
const path = require('path')
109
const spawn = require('child_process').spawn
@@ -34,9 +33,11 @@ Xvfb.prototype = {
3433
let didSpawnFail = false
3534
try {
3635
self._spawnProcess(exists, function(e) {
36+
// if we've already errored, noop
37+
if (didSpawnFail) return
38+
didSpawnFail = true
3739
debug('XVFB spawn failed')
3840
debug(e)
39-
didSpawnFail = true
4041
if (cb) cb(e)
4142
})
4243
} catch (e) {
@@ -153,7 +154,7 @@ Xvfb.prototype = {
153154
_spawnProcess(lockFileExists, onAsyncSpawnError) {
154155
let self = this
155156

156-
const onError = once(onAsyncSpawnError)
157+
const onError = onAsyncSpawnError
157158

158159
let display = self.display()
159160
if (lockFileExists) {

0 commit comments

Comments
 (0)