mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-15 00:15:27 +00:00
fix(core): Add cache for CDefaultsSize to avoid spamming SQL request (pgsql)
This commit is contained in:
@@ -273,9 +273,12 @@ static const NSString *kCDefaultsLenKey = @"kCDefaultsLenKey";
|
||||
[cm releaseChannel: channel immediately: YES];
|
||||
if (infos && [infos objectForKey:@"CHARACTER_MAXIMUM_LENGTH"]) {
|
||||
r = [[infos objectForKey:@"CHARACTER_MAXIMUM_LENGTH"] longLongValue];
|
||||
[cache setValue: [[NSNumber numberWithUnsignedLongLong: r] stringValue] forKey: kCDefaultsLenKey];
|
||||
} else if (infos && [infos objectForKey:@"character_maximum_length"]) { // PGSQL case
|
||||
r = [[infos objectForKey:@"character_maximum_length"] longLongValue];
|
||||
}
|
||||
}
|
||||
|
||||
[cache setValue: [[NSNumber numberWithUnsignedLongLong: r] stringValue] forKey: kCDefaultsLenKey];
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user