Skip to content

Commit

Permalink
🚸 wikidata improvements (#2952)
Browse files Browse the repository at this point in the history
  • Loading branch information
HerrLevin authored Oct 11, 2024
1 parent ef4fe74 commit e9ba8c2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/API/v1/ExperimentalController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function fetchWikidata(int $stationId): JsonResponse {

private static function checkGeneralRateLimit(): bool {
$key = "fetch-wikidata-user:" . auth()->id();
if (RateLimiter::tooManyAttempts($key, 10)) {
if (RateLimiter::tooManyAttempts($key, 20)) {
return false;
}
RateLimiter::increment($key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ public function indexHelpPage(): View {

//get stations the user was travelling recently, without a wikidata id
$destinationStationsWithoutWikidata = Station::join('train_stopovers', 'train_stations.id', '=', 'train_stopovers.train_station_id')
->join('train_checkins', 'train_checkins.destination_stopover_id', '=', 'train_stopovers.id')
->where('train_checkins.user_id', auth()->id())
->where('train_stations.ibnr', '>', 1000000)
->where('train_stations.ibnr', '>', 8000000)
->whereNull('train_stations.wikidata_id')
->select('train_stations.*')
->limit(50)
->orderByDesc('train_checkins.created_at')
->distinct()
->get();

Expand Down

0 comments on commit e9ba8c2

Please sign in to comment.