Merge branch 'hostname_variable' of github.com:clinta/lotus into feat/worker-name-set

This commit is contained in:
Łukasz Magiera 2022-08-03 12:40:18 +02:00
commit 4d10adae3c

View File

@ -774,9 +774,13 @@ func (l *LocalWorker) memInfo() (memPhysical, memUsed, memSwap, memSwapUsed uint
} }
func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error) { func (l *LocalWorker) Info(context.Context) (storiface.WorkerInfo, error) {
hostname, err := os.Hostname() // TODO: allow overriding from config hostname, ok := os.LookupEnv("LOTUS_WORKER_HOSTNAME")
if err != nil { if !ok {
panic(err) var err error
hostname, err = os.Hostname()
if err != nil {
panic(err)
}
} }
gpus, err := ffi.GetGPUDevices() gpus, err := ffi.GetGPUDevices()