This repository has been archived by the owner on Mar 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve non entity names outside of KM coroutine.
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Insight/InsightSubsystems/Cron/CronTasks/ResolveNonEntityNames.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from InsightSubsystems.Cron.CronTasks.AbstractCronTask import AbstractCronTask | ||
from database.db_tables.eve.mass_name_resolve import name_resolve | ||
|
||
class ResolveNonEntityNames(AbstractCronTask): | ||
def __init__(self, cron_manager): | ||
super().__init__(cron_manager) | ||
self.error_ids_404 = {} | ||
self.error_ids_non404 = {} | ||
|
||
def call_now(self) -> bool: | ||
return False | ||
|
||
def run_at_intervals(self) -> bool: | ||
return False | ||
|
||
def loop_iteration(self) -> int: | ||
return 3600 | ||
|
||
def _resolve_names(self): | ||
name_resolve.api_mass_name_resolve(self.service, error_ids_404=self.error_ids_404, | ||
error_ids_non404=self.error_ids_non404, exclude_nonentity=False, | ||
exclude_entity=True) | ||
|
||
async def _run_task(self): | ||
await self.loop.run_in_executor(None, self._resolve_names) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters