Skip to content

Commit a60a53b

Browse files
committed
resources/client: also repair/remove LevelDB for IO errors (renaming failed, missing files)
1 parent 0b39156 commit a60a53b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

code/components/citizen-resources-client/src/KVScriptFunctions.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ struct DatabaseHolder
2525

2626
if (!status.ok())
2727
{
28-
if (status.IsCorruption())
28+
if (status.IsCorruption() || status.IsIOError())
2929
{
3030
leveldb::Options repairOptions;
3131
repairOptions.reuse_logs = false;

code/components/citizen-resources-client/src/ResourceCache.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void ResourceCache::OpenDatabase()
3535

3636
auto status = leveldb::DB::Open(options, m_cachePath + "/db/", &dbPointer);
3737

38-
if (status.IsCorruption())
38+
if (status.IsCorruption() || status.IsIOError())
3939
{
4040
leveldb::Options repairOptions;
4141
repairOptions.reuse_logs = false;

0 commit comments

Comments
 (0)