Fix nodelist crc's that have 8 chars

This commit is contained in:
Deon George
2022-11-12 00:15:45 +11:00
parent b158bb5a7d
commit e7ebaa85cb
2 changed files with 7 additions and 4 deletions

View File

@@ -378,10 +378,13 @@ class NodelistImport implements ShouldQueue
Address::whereIN('id',$remove->pluck('id')->toArray())->update(['active'=>FALSE]);
Address::whereIN('id',$remove->pluck('id')->toArray())->delete();
if (crc16(substr($tocrc,0,-3)) == $file_crc)
if ($x=crc16(substr($tocrc,0,-3)) == $file_crc) {
Log::info(sprintf('%s:Committing nodelist',self::LOGKEY));
DB::commit();
else
} else {
Log::error(sprintf('%s:Rolling back nodelist, CRC doesnt match [%s](%s)',self::LOGKEY,$x,$file_crc));
DB::rollBack();
}
fclose($fh);