Skip to content
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

Remove usage of old score es index #11544

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ CLIENT_CHECK_VERSION=false
# BAN_PERSIST_DAYS=28

# ES_HOST=localhost:9200
# ES_SCORES_HOST=localhost:9200
# ES_SOLO_SCORES_HOST=localhost:9200
# ES_INDEX_PREFIX=
# ES_CLIENT_TIMEOUT=5
Expand Down
30 changes: 0 additions & 30 deletions app/Console/Commands/UserBestScoresCheckCommand.php

This file was deleted.

12 changes: 0 additions & 12 deletions app/Http/Controllers/LegacyInterOpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use App\Jobs\Notifications\ForumTopicReply;
use App\Jobs\RegenerateBeatmapsetCover;
use App\Libraries\Chat;
use App\Libraries\UserBestScoresCheck;
use App\Models\Beatmap;
use App\Models\Beatmapset;
use App\Models\Chat\Channel;
Expand Down Expand Up @@ -297,17 +296,6 @@ public function userBatchSendMessage()
return response()->json($results);
}

public function userBestScoresCheck($id)
{
$user = User::findOrFail($id);

foreach (Beatmap::MODES as $mode => $_v) {
(new UserBestScoresCheck($user))->run($mode);
}

return ['success' => true];
}

public function userIndex($id)
{
$user = User::findOrFail($id);
Expand Down
8 changes: 0 additions & 8 deletions app/Jobs/RemoveBeatmapsetBestScores.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
namespace App\Jobs;

use App\Libraries\Elasticsearch\BoolQuery;
use App\Libraries\Elasticsearch\Es;
use App\Models\Beatmap;
use App\Models\Beatmapset;
use App\Models\Score\Best\Model;
Expand Down Expand Up @@ -57,13 +56,6 @@ public function handle()
$query->filter(['terms' => ['beatmap_id' => $beatmapIds]]);
$query->filter(['range' => ['score_id' => ['lte' => $this->maxScoreIds[$mode]]]]);

// TODO: do something with response?
Es::getClient('scores')->deleteByQuery([
'index' => $GLOBALS['cfg']['osu']['elasticsearch']['prefix']."high_scores_{$mode}",
'body' => ['query' => $query->toArray()],
'client' => ['ignore' => 404],
]);

$class = Model::getClass($mode);
// Just delete until no more matching rows.
$query = $class
Expand Down
116 changes: 0 additions & 116 deletions app/Libraries/UserBestScoresCheck.php

This file was deleted.

3 changes: 0 additions & 3 deletions config/elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
'default' => array_merge($defaults, [
'hosts' => $parseHosts('ES_HOST'),
]),
'scores' => array_merge($defaults, [
'hosts' => $parseHosts('ES_SCORES_HOST'),
]),
'solo_scores' => array_merge($defaults, [
'hosts' => $parseHosts('ES_SOLO_SCORES_HOST'),
]),
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ x-env: &x-env
DB_CONNECTION_STRING: Server=db;Database=osu;Uid=osuweb;
DB_HOST: db
ES_HOST: http://elasticsearch:9200
ES_SCORES_HOST: http://elasticsearch:9200
ES_SOLO_SCORES_HOST: http://elasticsearch:9200
GITHUB_TOKEN: "${GITHUB_TOKEN}"
NOTIFICATION_REDIS_HOST: redis
Expand Down
1 change: 0 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@
Route::post('generate-notification', 'LegacyInterOpController@generateNotification');
Route::post('index-beatmapset/{beatmapset}', 'LegacyInterOpController@indexBeatmapset');
Route::post('/refresh-beatmapset-cache/{beatmapset}', 'LegacyInterOpController@refreshBeatmapsetCache');
Route::post('/user-best-scores-check/{user}', 'LegacyInterOpController@userBestScoresCheck');
Route::post('user-send-message', 'LegacyInterOpController@userSendMessage');
Route::post('user-batch-mark-channel-as-read', 'LegacyInterOpController@userBatchMarkChannelAsRead');
Route::post('user-batch-send-message', 'LegacyInterOpController@userBatchSendMessage');
Expand Down