diff --git a/include/reHDD.h b/include/reHDD.h index eb56a2e..30a59a8 100644 --- a/include/reHDD.h +++ b/include/reHDD.h @@ -14,7 +14,7 @@ #define WORSE_HOURS 19200 //mark drive if at this limit or beyond #define WORSE_POWERUP 10000 //mark drive if at this limit or beyond #define SHRED_ITERATIONS 3U -#define FROZEN_TIMEOUT 10 //After this timeout (minutes) the drive will be marked as frozen +#define FROZEN_TIMEOUT 20 //After this timeout (minutes) the drive will be marked as frozen #define METRIC_THRESHOLD 3L*1000L*1000L*1000L //calc shred speed with this minimum of time delta // Logger Settings diff --git a/include/shred.h b/include/shred.h index f44a32e..c423d36 100644 --- a/include/shred.h +++ b/include/shred.h @@ -23,6 +23,7 @@ //#define DEMO_DRIVE_SIZE 1024*1024*256L // 256MB //#define DEMO_DRIVE_SIZE 1024*1024*1024L // 1GB +//#define DEMO_DRIVE_SIZE 5*1024*1024*1024L // 5GB //#define DEMO_DRIVE_SIZE 1024*1024*1024*10L // 10GB typedef int fileDescriptor; diff --git a/src/drive.cpp b/src/drive.cpp index 837b089..70006f8 100644 --- a/src/drive.cpp +++ b/src/drive.cpp @@ -167,7 +167,7 @@ void Drive::checkFrozenDrive(void) time_t u32localtime; time(&u32localtime); - if((u32localtime - this->u32Timestamp) >= (FROZEN_TIMEOUT*60) && (this->u32Timestamp > 0)) + if((u32localtime - this->u32Timestamp) >= (FROZEN_TIMEOUT*60) && (this->u32Timestamp > 0) && (this->getTaskPercentage() < 100.0)) { Logger::logThis()->warning("Drive Frozen: " + this->getModelName() + " " + this->getSerial()); this->bWasDeleteted = false; diff --git a/src/shred.cpp b/src/shred.cpp index 0734030..aaf541f 100644 --- a/src/shred.cpp +++ b/src/shred.cpp @@ -270,10 +270,11 @@ unsigned int Shred::uiCalcChecksum(fileDescriptor file,Drive* drive, int* ipSign ulDriveByteCounter += iReadBytes; ulDriveByteOverallCount += iReadBytes; d32Percent = this->calcProgress(); + drive->sShredSpeed.ulSpeedMetricBytesWritten += iReadBytes; #ifdef LOG_LEVEL_HIGH Logger::logThis()->info("Shred-Task (Checksum): ByteCount: " + to_string(ulDriveByteCounter) + " - progress: " + to_string(d32Percent) + " - Drive: " + drive->getSerial()); #endif - if((d32Percent-d32TmpPercent) >= 0.9) + if((d32Percent-d32TmpPercent) >= 0.01) { drive->setTaskPercentage(d32TmpPercent); d32TmpPercent = d32Percent;