Skip to content

Commit

Permalink
Use github task for update.
Browse files Browse the repository at this point in the history
  • Loading branch information
xwertxy committed Dec 6, 2023
1 parent f38b834 commit 087d96b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ReinfyTeam/ProfanityFilter/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
use pocketmine\utils\Config;
use pocketmine\utils\SingletonTrait;
use ReinfyTeam\ProfanityFilter\Command\DefaultCommand;
use ReinfyTeam\ProfanityFilter\Tasks\PoggitUpdateTask;
use ReinfyTeam\ProfanityFilter\Tasks\GithubUpdateTask;
use ReinfyTeam\ProfanityFilter\Utils\Language;
use function fclose;
use function file;
Expand Down Expand Up @@ -111,7 +111,7 @@ private function registerCommands() : void {
private function checkUpdate() : void {
$lang = new Language();
if ($this->getConfig()->get("check-updates")) {
$this->getServer()->getAsyncPool()->submitTask(new PoggitUpdateTask($this->getDescription()->getName(), $this->getDescription()->getVersion()));
$this->getServer()->getAsyncPool()->submitTask(new GithubUpdateTask($this->getDescription()->getName(), $this->getDescription()->getVersion()));
} else {
$this->getServer()->getLogger()->warning($lang->translateMessage("new-update-prefix") . " " . $lang->translateMessage("update-warning"));
}
Expand Down
2 changes: 1 addition & 1 deletion src/ReinfyTeam/ProfanityFilter/Tasks/GithubUpdateTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function onCompletion() : void {

if ($err !== null) {
Server::getInstance()->getLogger()->critical($lang->translateMessage("new-update-prefix") . " " . vsprintf($lang->translateMessage("update-error"), [$err]));
Server::getInstance()->getLogger()->notice($lang->translateMessage("new-update-prefix") . " " . $lang->translateMessage("update-retry-failed"));
//Server::getInstance()->getLogger()->notice($lang->translateMessage("new-update-prefix") . " " . $lang->translateMessage("update-retry-failed"));
return;
}

Expand Down

0 comments on commit 087d96b

Please sign in to comment.