Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Commit 17588b9

Browse files
committed
Fixed unnecessary INSERT's to hints_log table
1 parent 43b45c3 commit 17588b9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/models/Level.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,14 +1194,16 @@ private static function levelFromRow(Map<string, string> $row): Level {
11941194
}
11951195

11961196
// Adjust points and log the hint
1197-
await \HH\Asio\va(
1198-
$db->queryf(
1199-
'UPDATE teams SET points = points - %d WHERE id = %d LIMIT 1',
1200-
$penalty,
1201-
$team_id,
1202-
),
1203-
HintLog::genLogGetHint($level_id, $team_id, $penalty),
1204-
);
1197+
if (!$hint) {
1198+
await \HH\Asio\va(
1199+
$db->queryf(
1200+
'UPDATE teams SET points = points - %d WHERE id = %d LIMIT 1',
1201+
$penalty,
1202+
$team_id,
1203+
),
1204+
HintLog::genLogGetHint($level_id, $team_id, $penalty),
1205+
);
1206+
}
12051207

12061208
MultiTeam::invalidateMCRecords('ALL_TEAMS'); // Invalidate Memcached MultiTeam data.
12071209
MultiTeam::invalidateMCRecords('POINTS_BY_TYPE'); // Invalidate Memcached MultiTeam data.

0 commit comments

Comments
 (0)