This commit is contained in:
shenlong-tanwen 2025-04-04 01:55:29 +05:30
parent 1fdb78b05d
commit afd664d8f2
4 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,9 @@ const double downloadFailed = -2;
// Number of log entries to retain on app start
const int kLogTruncateLimit = 250;
// Duration for backgroun sync
// Duration for background sync
const Duration kBackgroundSyncDuration = Duration(minutes: 1);
// Hash batch limits
const int kBatchHashFileLimit = 128;
const int kBatchHashSizeLimit = 1024 * 1024 * 1024; // 1GB

View File

@ -60,7 +60,6 @@ class SyncApiRepository implements ISyncApiRepository {
await for (final chunk in response.stream.transform(utf8.decoder)) {
previousChunk += chunk;
// ignore: move-variable-outside-iteration
final parts = previousChunk.toString().split('\n');
previousChunk = parts.removeLast();
lines.addAll(parts);

View File

@ -50,14 +50,13 @@ Future<T?> runInIsolate<T>(
await Future.delayed(Durations.short2);
return result;
} catch (error, stack) {
// Log the error and stack trace
log.severe(
"Error in runInIsolate${debugLabel == null ? '' : ' for $debugLabel'}",
error,
stack,
);
} finally {
// Always close the new database connection on Isolate end
// Always close the new db connection on Isolate end
ref.read(driftProvider).close();
ref.read(dbProvider).close();
ref.read(isarProvider).close();