Skip to content

Commit

Permalink
Remove deprecated createEventSource
Browse files Browse the repository at this point in the history
  • Loading branch information
kesselb authored May 26, 2023
1 parent bdbe521 commit 5335488
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Controller/ScannerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ public function __construct(
$this->DBController = $DBController;
$this->SettingController = $SettingController;
$this->IDateTimeZone = $IDateTimeZone;
$this->eventSource = OC::$server->createEventSource();
$this->lastUpdated = time();

// @TODO: Remove method_exists when min-version="28"
if (method_exists(\OC::$server, 'createEventSource')) {
$this->eventSource = \OC::$server->createEventSource();
} else {
$this->eventSource = \OCP\Server::get(IEventSource::class);
}
}

/**
Expand Down

0 comments on commit 5335488

Please sign in to comment.