fix(sogo-tool): prevent a bug when restoring two events with same id

This commit is contained in:
Hivert Quentin
2024-09-11 17:56:45 +02:00
parent 68f4fc1343
commit 84fe91c29c

View File

@@ -419,6 +419,7 @@
max = [records count]; max = [records count];
for (count = 0; count < max; count++) for (count = 0; count < max; count++)
{ {
version = 0;
if (count > 0 && count%100 == 0) if (count > 0 && count%100 == 0)
{ {
DESTROY(pool); DESTROY(pool);
@@ -428,7 +429,7 @@
cName = [currentRecord objectForKey: @"c_name"]; cName = [currentRecord objectForKey: @"c_name"];
if (![existingRecords objectForKey: cName]) if (![existingRecords objectForKey: cName])
{ {
NSLog (@"restoring record '%@'", cName); NSLog (@"restoring record '%@' with version %d", cName, version);
cContent = [currentRecord objectForKey: @"c_content"]; cContent = [currentRecord objectForKey: @"c_content"];
[gcsFolder writeContent: cContent [gcsFolder writeContent: cContent
fromComponent: [[self parsingClassForContent: cContent] parseSingleFromSource: cContent] fromComponent: [[self parsingClassForContent: cContent] parseSingleFromSource: cContent]