mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-25 04:27:22 +08:00
log checkMinInterval
This commit is contained in:
@@ -422,13 +422,14 @@ class TrackerRepository extends BaseRepository
|
|||||||
->where('peer_id', $queries['peer_id'])
|
->where('peer_id', $queries['peer_id'])
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if (
|
if ($peer) {
|
||||||
$peer
|
do_log(sprintf(
|
||||||
&& $queries['event'] == ''
|
'event: %s, prev_action: %s, isValidDate: %s, diffInSeconds: %s',
|
||||||
&& $peer->isValidDate('prev_action')
|
$queries['event'], $peer->prev_action, var_export($peer->isValidDate('prev_action'), true), Carbon::now()->diffInSeconds($peer->prev_action)
|
||||||
&& Carbon::now()->diffInSeconds($peer->prev_action) < self::MIN_ANNOUNCE_WAIT_SECOND
|
));
|
||||||
) {
|
if ($queries['event'] == '' && $peer->isValidDate('prev_action') && Carbon::now()->diffInSeconds($peer->prev_action) < self::MIN_ANNOUNCE_WAIT_SECOND) {
|
||||||
throw new TrackerException('There is a minimum announce time of ' . self::MIN_ANNOUNCE_WAIT_SECOND . ' seconds');
|
throw new TrackerException('There is a minimum announce time of ' . self::MIN_ANNOUNCE_WAIT_SECOND . ' seconds');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $peer;
|
return $peer;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user