Remove special casing for background execution

This commit is contained in:
vishnukvmd 2024-02-18 11:02:07 +05:30
parent c821d6e2a5
commit d8541e6a46
2 changed files with 2 additions and 9 deletions

View file

@ -194,7 +194,7 @@ Future<void> _init(bool isBackground, {String via = ''}) async {
});
}
unawaited(FeatureFlagService.instance.init());
unawaited(SemanticSearchService.instance.init(isInBackground: isBackground));
unawaited(SemanticSearchService.instance.init());
MachineLearningController.instance.init();
// Can not including existing tf/ml binaries as they are not being built
// from source.

View file

@ -55,10 +55,7 @@ class SemanticSearchService {
get hasInitialized => _hasInitialized;
Future<void> init({
bool shouldSyncImmediately = false,
bool isInBackground = false,
}) async {
Future<void> init({bool shouldSyncImmediately = false}) async {
if (!LocalSettings.instance.hasEnabledMagicSearch()) {
return;
}
@ -103,10 +100,6 @@ class SemanticSearchService {
if (shouldSyncImmediately) {
unawaited(sync());
}
if (isInBackground) {
// Do not block on user interactions
_startIndexing();
}
Bus.instance.on<MachineLearningControlEvent>().listen((event) {
if (event.shouldRun) {
_startIndexing();