Merge pull request #4627 from karalabe/fix-gpu-usage-tracking

extern/sector-storage: fix GPU usage overwrite bug
This commit is contained in:
Łukasz Magiera 2020-10-29 10:13:54 +01:00 committed by GitHub
commit f0f75e2d2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,9 @@ func (a *activeResources) withResources(id WorkerID, wr storiface.WorkerResource
}
func (a *activeResources) add(wr storiface.WorkerResources, r Resources) {
a.gpuUsed = r.CanGPU
if r.CanGPU {
a.gpuUsed = true
}
a.cpuUse += r.Threads(wr.CPUs)
a.memUsedMin += r.MinMemory
a.memUsedMax += r.MaxMemory