more refactors

This commit is contained in:
shenlong-tanwen
2024-10-20 16:50:34 +05:30
parent 7ea21d636f
commit 8f47645cdb
35 changed files with 399 additions and 83 deletions
+2 -2
View File
@@ -69,12 +69,12 @@ class IsolateHelper {
BackgroundIsolateBinaryMessenger.ensureInitialized(token);
DartPluginRegistrant.ensureInitialized();
// Delay to ensure the isolate is ready
await Future.delayed(const Duration(milliseconds: 100));
await Future.delayed(Durations.short2);
helper.postIsolateHandling();
try {
final result = await computation();
// Delay to ensure the isolate is not killed prematurely
await Future.delayed(const Duration(milliseconds: 100));
await Future.delayed(Durations.short2);
return result;
} finally {
// Always close the new database connection on Isolate end