Closed herpaderpaldent closed 3 months ago
Implementin' a Fresh Service for Updatin' Character Affiliations
We've added a piece 'o eight in the form of a new service, christened RefreshCharacterAffiliationsService
. This service be dispatchin' a task, known as CharacterAffiliationJob
, which updates character loyalties and alliances.
Updated Service Provider to Use Our New Refresh Service
We've made some changes to EveapiServiceProvider.php
so as it now uses our shiny, new RefreshCharacterAffiliationsService
in the scheduler, replacin' the older CharacterAffiliationJob
.
A New Name for Our Trusty CharacterAffiliationService
We've bestowed a new name upon CharacterAffiliationService.php
, it now be known as CacheCharacterAffiliationIdsService.php
.
Usin' the Renamed Service in Other Parts of The Code
ProcessContactResponse.php
and UpdateCorporation.php
have been modified to use our newly renamed CacheCharacterAffiliationIdsService
instead of the old CharacterAffiliationService
.
Improvin' Efficiency For UpdateCorporation
In UpdateCorporation.php
, we've made it so the corporation
and character.roles
relationships will be eager loaded. This will optimize load times when these relationships are used.
Test Changes Reflectin' Our Code Upgrades The tests relatin' to character affiliation have been updated to match our code changes. We've added a new test for the Refresh service, removed outdated time-based tests, and updated existing test to use our new Service.
Walkin' the Plank Unused Imports and Redundant Code We sent any unused imports and any redundant pieces 'o code to Davy Jones' locker.
Note: The changes include everything from new files, modifications to existing ones and changes to tests.
Code Climate has analyzed commit 7f98a2a0 and detected 3 issues on this pull request.
Here's the issue category breakdown:
Category | Count |
---|---|
Clarity | 2 |
Style | 1 |
The test coverage on the diff in this pull request is 100.0% (50% is the threshold).
This pull request will bring the total coverage in the repository to 90.1%.
View more on Code Climate.
This addresses the second part of https://github.com/seatplus/eveapi/issues/650
First of all, a new
RefreshCharacterAffiliationsService
has been created that replaces some logic that was previously within theCharacterAffiliationJob
.This sevices checks every 5 minutes if:
if this is the case the ids are being dispatched.
CharacterAffiliationJob
complexity has reduced. Its cleaner now and tests has been simplified by doing this. Resulting in better testability. Also the job now concentrates again in only one thing - getting the character_affiliations from ESI. Also refactoring lead to simplification and more explicit design, making it easier to maintain