Skip to content

Commit a6a1dbc

Browse files
committedNov 28, 2015
introduce low memory flag
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent b4ab684 commit a6a1dbc

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
 

‎cmd/ipfs/main.go

+3
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ func (i *cmdInvocation) Run(ctx context.Context) (output io.Reader, err error) {
182182
if u.GetenvBool("DEBUG") {
183183
u.Debug = true
184184
}
185+
if u.GetenvBool("IPFS_LOW_MEM") {
186+
u.LowMemMode = true
187+
}
185188

186189
res, err := callCommand(ctx, i.req, Root, i.cmd)
187190
if err != nil {

‎util/util.go

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ import (
2222
// Debug is a global flag for debugging.
2323
var Debug bool
2424

25+
// LowMemMode is a global flag to signify that processes should use fewer resources
26+
var LowMemMode bool
27+
2528
// ErrNotImplemented signifies a function has not been implemented yet.
2629
var ErrNotImplemented = errors.New("Error: not implemented yet.")
2730

0 commit comments

Comments
 (0)
Please sign in to comment.