MCPcopy Index your code
hub / github.com/dgraph-io/dgraph / validate

Method validate

worker/config.go:89–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

87var AvailableMemory int64
88
89func (opt *Options) validate() {
90 pd, err := filepath.Abs(opt.PostingDir)
91 x.Check(err)
92 wd, err := filepath.Abs(opt.WALDir)
93 x.Check(err)
94 td, err := filepath.Abs(x.WorkerConfig.TmpDir)
95 x.Check(err)
96 x.AssertTruef(pd != wd,
97 "Posting and WAL directory cannot be the same ('%s').", opt.PostingDir)
98 x.AssertTruef(pd != td,
99 "Posting and Tmp directory cannot be the same ('%s').", opt.PostingDir)
100 x.AssertTruef(wd != td,
101 "WAL and Tmp directory cannot be the same ('%s').", opt.WALDir)
102 if opt.Audit != nil {
103 ad, err := filepath.Abs(opt.Audit.Output)
104 x.Check(err)
105 x.AssertTruef(ad != pd,
106 "Posting directory and Audit Output cannot be the same ('%s').", opt.Audit.Output)
107 x.AssertTruef(ad != wd,
108 "WAL directory and Audit Output cannot be the same ('%s').", opt.Audit.Output)
109 x.AssertTruef(ad != td,
110 "Tmp directory and Audit Output cannot be the same ('%s').", opt.Audit.Output)
111 }
112}
113
114// String implements the Stringer interface to redact sensitive fields when logging.
115func (opt Options) String() string {

Callers 2

InitServerStateFunction · 0.45
SetConfigurationFunction · 0.45

Calls 2

CheckFunction · 0.92
AssertTruefFunction · 0.92

Tested by

no test coverage detected