Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 9470900

Browse files
author
Alan Shaw
authored
feat: add --enable-preload to enable/disable preloading for daemons (#1909)
License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 3fff46a commit 9470900

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/cli/commands/daemon.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ module.exports = {
2626
type: 'boolean',
2727
default: false
2828
})
29+
.option('enable-preload', {
30+
type: 'boolean',
31+
default: true
32+
})
2933
},
3034

3135
handler (argv) {
@@ -41,6 +45,7 @@ module.exports = {
4145
repo: process.env.IPFS_PATH,
4246
offline: argv.offline,
4347
pass: argv.pass,
48+
preload: { enabled: argv.enablePreload },
4449
EXPERIMENTAL: {
4550
pubsub: argv.enablePubsubExperiment,
4651
ipnsPubsub: argv.enableNamesysPubsub,

src/core/preload.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module.exports = self => {
1818
options.addresses = options.addresses || []
1919

2020
if (!options.enabled || !options.addresses.length) {
21+
log('preload disabled')
2122
const api = (_, callback) => {
2223
if (callback) {
2324
setImmediate(() => callback())

0 commit comments

Comments
 (0)