mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-03 20:22:59 +00:00
Decaf cleanup: remove IIFEs
This commit is contained in:
parent
f650da8675
commit
32f0bbe266
1 changed files with 20 additions and 34 deletions
|
@ -8,7 +8,6 @@
|
||||||
// Fix any style issues and re-enable lint.
|
// Fix any style issues and re-enable lint.
|
||||||
/*
|
/*
|
||||||
* decaffeinate suggestions:
|
* decaffeinate suggestions:
|
||||||
* DS205: Consider reworking code to avoid use of IIFEs
|
|
||||||
* DS207: Consider shorter variations of null checks
|
* DS207: Consider shorter variations of null checks
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||||
*/
|
*/
|
||||||
|
@ -278,23 +277,11 @@ module.exports = DockerRunner = {
|
||||||
NetworkDisabled: true,
|
NetworkDisabled: true,
|
||||||
Memory: 1024 * 1024 * 1024 * 1024, // 1 Gb
|
Memory: 1024 * 1024 * 1024 * 1024, // 1 Gb
|
||||||
User: Settings.clsi.docker.user,
|
User: Settings.clsi.docker.user,
|
||||||
Env: (() => {
|
Env: Object.entries(env).map(([key, value]) => `${key}=${value}`),
|
||||||
const result = []
|
|
||||||
for (key in env) {
|
|
||||||
value = env[key]
|
|
||||||
result.push(`${key}=${value}`)
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
})(), // convert the environment hash to an array
|
|
||||||
HostConfig: {
|
HostConfig: {
|
||||||
Binds: (() => {
|
Binds: Object.entries(volumes).map(
|
||||||
const result1 = []
|
([hostVol, dockerVol]) => `${hostVol}:${dockerVol}`
|
||||||
for (hostVol in volumes) {
|
),
|
||||||
dockerVol = volumes[hostVol]
|
|
||||||
result1.push(`${hostVol}:${dockerVol}`)
|
|
||||||
}
|
|
||||||
return result1
|
|
||||||
})(),
|
|
||||||
LogConfig: { Type: 'none', Config: {} },
|
LogConfig: { Type: 'none', Config: {} },
|
||||||
Ulimits: [
|
Ulimits: [
|
||||||
{
|
{
|
||||||
|
@ -399,7 +386,7 @@ module.exports = DockerRunner = {
|
||||||
})
|
})
|
||||||
const jobs = []
|
const jobs = []
|
||||||
for (const vol in volumes) {
|
for (const vol in volumes) {
|
||||||
;((vol) => jobs.push((cb) => checkVolume(vol, cb)))(vol)
|
jobs.push((cb) => checkVolume(vol, cb))
|
||||||
}
|
}
|
||||||
async.series(jobs, callback)
|
async.series(jobs, callback)
|
||||||
},
|
},
|
||||||
|
@ -655,7 +642,6 @@ module.exports = DockerRunner = {
|
||||||
}
|
}
|
||||||
const jobs = []
|
const jobs = []
|
||||||
for (const container of containers) {
|
for (const container of containers) {
|
||||||
;((container) =>
|
|
||||||
DockerRunner.examineOldContainer(container, function (
|
DockerRunner.examineOldContainer(container, function (
|
||||||
err,
|
err,
|
||||||
name,
|
name,
|
||||||
|
@ -670,7 +656,7 @@ module.exports = DockerRunner = {
|
||||||
DockerRunner.destroyContainer(name, id, false, () => cb())
|
DockerRunner.destroyContainer(name, id, false, () => cb())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}))(container)
|
})
|
||||||
}
|
}
|
||||||
// Ignore errors because some containers get stuck but
|
// Ignore errors because some containers get stuck but
|
||||||
// will be destroyed next time
|
// will be destroyed next time
|
||||||
|
|
Loading…
Reference in a new issue