Defensive drive state (#89)

fixes #79

Reviewed-on: #89
Co-authored-by: localhorst <localhorst@mosad.xyz>
Co-committed-by: localhorst <localhorst@mosad.xyz>
This commit is contained in:
2025-12-12 22:46:21 +01:00
committed by Hendrik Schutter
parent 1449e807ad
commit 1dce303ab6
2 changed files with 4 additions and 2 deletions

View File

@ -542,7 +542,6 @@ void reHDD::startShredAllDrives(list<Drive> *plistDrives)
address << (void const *)&(*pTmpDrive);
Logger::logThis()->info("Started shred (all) for: " + pTmpDrive->getModelName() + "-" + pTmpDrive->getSerial() + " @" + address.str());
#endif
pTmpDrive->state = Drive::TaskState::SHRED_ACTIVE;
thread(ThreadShred, pTmpDrive).detach();
}
}
@ -694,7 +693,6 @@ void reHDD::handleEnter()
if (tmpSelectedDrive->state == Drive::TaskState::SHRED_SELECTED)
{
Logger::logThis()->info("Started shred/check for: " + tmpSelectedDrive->getModelName() + "-" + tmpSelectedDrive->getSerial());
tmpSelectedDrive->state = Drive::TaskState::SHRED_ACTIVE;
// task for drive is running --> don't show more task option
thread(ThreadShred, tmpSelectedDrive).detach();
}