()
| 87 | var AvailableMemory int64 |
| 88 | |
| 89 | func (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. |
| 115 | func (opt Options) String() string { |
no test coverage detected