Skip to content

Commit

Permalink
Remove obsolete task scheduler for search. (#6794)
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Jun 28, 2023
1 parent 0abd33e commit ea441d2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 64 deletions.
3 changes: 1 addition & 2 deletions app/lib/search/updater.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ class IndexUpdater implements TaskRunner {
}

/// Starts the scheduler to update the package index.
void runScheduler({required Stream<Task> manualTriggerTasks}) {
void runScheduler() {
final scheduler = TaskScheduler(
this,
[
ManualTriggerTaskSource(manualTriggerTasks),
DatastoreHeadTaskSource(
_db,
TaskSourceModel.package,
Expand Down
7 changes: 1 addition & 6 deletions app/lib/service/entrypoint/search.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import '../../shared/env_config.dart';
import '../../shared/handler_helpers.dart';
import '../../shared/popularity_storage.dart';
import '../../shared/scheduler_stats.dart';
import '../../shared/task_client.dart';
import '../../shared/task_scheduler.dart';
import '../../tool/neat_task/pub_dev_tasks.dart';

import '_isolate.dart';
Expand Down Expand Up @@ -54,9 +52,6 @@ Future _main(FrontendEntryMessage message) async {

await popularityStorage.start();

final ReceivePort taskReceivePort = ReceivePort();
registerTaskSendPort(taskReceivePort.sendPort);

// Don't block on init, we need to serve liveliness and readiness checks.
scheduleMicrotask(() async {
await dartSdkMemIndex.start();
Expand All @@ -68,7 +63,7 @@ Future _main(FrontendEntryMessage message) async {
rethrow;
}

indexUpdater.runScheduler(manualTriggerTasks: taskReceivePort.cast<Task>());
indexUpdater.runScheduler();
});

await runHandler(_logger, searchServiceHandler);
Expand Down
46 changes: 0 additions & 46 deletions app/lib/shared/task_client.dart

This file was deleted.

10 changes: 0 additions & 10 deletions app/lib/shared/task_scheduler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ abstract class TaskSource {
Stream<Task> startStreaming();
}

/// Tasks coming from through the isolate's receivePort, originating from a
/// HTTP handler that received a ping after a new upload.
class ManualTriggerTaskSource implements TaskSource {
final Stream<Task> _taskReceivePort;
ManualTriggerTaskSource(this._taskReceivePort);

@override
Stream<Task> startStreaming() => _taskReceivePort;
}

/// Schedules and executes tasks.
///
/// The execution of the tasks are prioritized in the order of the task sources:
Expand Down

0 comments on commit ea441d2

Please sign in to comment.