-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add items and properties counts to PlatformStatsSummaryJob #795
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, I left an idea about how to get rid of the duplication of code that this now introduces. Let me know what you think.
Co-authored-by: Frederik Ring <frederik.ring@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left two more final comments, other than that 🚀
app/Traits/PageFetcher.php
Outdated
//this function is used to fetch pages on namespace | ||
function fetchPagesInNamespace(string $wikiDomain, int $namespace): array | ||
{ | ||
$this->apiUrl = getenv('PLATFORM_MW_BACKEND_HOST').'/w/api.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I feel the trait reading configuration values all by itself is a bit of "overstepping" its own responsibilities (the trait shouldn't have any idea how it's being configured), so how about:
- setting the
apiUrl
prop in the class constructors as before - in this method, raise a
RuntimeException
in case it hasn't been set
@@ -28,17 +30,25 @@ | |||
*/ | |||
class PlatformStatsSummaryJob extends Job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job now probably requires an increased timeout
value so that in production it doesn't get killed by the supervisor while still fetching data. Other jobs that poll all wikis currently use a value of 1800
so maybe it's a good idea to use the same one here. E.g.:
api/app/Jobs/PollForMediaWikiJobsJob.php
Line 13 in 5037c4f
public $timeout = 1800; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now, let's try this out in staging.
app/Jobs/PlatformStatsSummaryJob.php
Outdated
use App\Helper\MWTimestampHelper; | ||
use App\Wiki; | ||
use App\User; | ||
use Illuminate\Database\DatabaseManager; | ||
use Illuminate\Support\Facades\Http; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken this is not used anymore now that the code has been moved to the trait, but it also won't really hurt much.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yes I missed that
Would you mind adding a CHANGELOG entry still before merging? No need to get this reviewed though. |
No description provided.