fix update peer last_action

This commit is contained in:
xiaomlove
2022-04-08 22:47:38 +08:00
parent ea48fec2df
commit 7482722504

View File

@@ -732,16 +732,16 @@ class TrackerRepository extends BaseRepository
$peer->agent = $queries['user_agent'];
$peer->updateConnectableStateIfNeeded();
if ($peer->exists) {
$peer->prev_action = $peer->last_action;
}
$peer->to_go = $queries['left'];
$peer->seeder = $queries['left'] == 0 ? 'yes' : 'no';
$peer->last_action = $nowStr;
$peer->uploaded = $queries['uploaded'];
$peer->downloaded = $queries['downloaded'];
if ($peer->exists) {
$peer->prev_action = DB::raw('last_action');
}
if ($queries['event'] == 'started' || !$peer->exists) {
$peer->started = $nowStr;
$peer->uploadoffset = $queries['uploaded'];