|
@@ -130,16 +130,16 @@ class PackageController extends Controller
|
|
|
|
|
|
$actions = [];
|
|
$actions = [];
|
|
foreach ($dumps as $package => $time) {
|
|
foreach ($dumps as $package => $time) {
|
|
- // we subtract 1s to the time for safety, as filemtime can be a little before the logged time (see https://gist.github.com/Seldaek/a5cf4a5551139bc41fb130fa16406290)
|
|
|
|
- $actions[$package] = ['type' => 'update', 'package' => $package, 'time' => floor($time / 10000) - 1];
|
|
|
|
|
|
+ // we subtract .2s from the time for safety, as filemtime can be a little before the logged time (see https://gist.github.com/Seldaek/a5cf4a5551139bc41fb130fa16406290)
|
|
|
|
+ $actions[$package] = ['type' => 'update', 'package' => $package, 'time' => floor(($time - 2000) / 10000)];
|
|
}
|
|
}
|
|
foreach ($deletes as $package => $time) {
|
|
foreach ($deletes as $package => $time) {
|
|
// if a package is dumped then deleted then dumped again because it gets re-added, we want to keep the update action
|
|
// if a package is dumped then deleted then dumped again because it gets re-added, we want to keep the update action
|
|
// but if it is deleted and marked as dumped within 10 seconds of the deletion, it probably was a race condition between
|
|
// but if it is deleted and marked as dumped within 10 seconds of the deletion, it probably was a race condition between
|
|
// dumped job and deletion, so let's replace it by a delete job anyway
|
|
// dumped job and deletion, so let's replace it by a delete job anyway
|
|
$newestUpdate = max($actions[$package]['time'] ?? 0, $actions[$package.'~dev']['time'] ?? 0);
|
|
$newestUpdate = max($actions[$package]['time'] ?? 0, $actions[$package.'~dev']['time'] ?? 0);
|
|
- if ($newestUpdate < $time + (10 * 10000)) {
|
|
|
|
- $actions[$package] = ['type' => 'delete', 'package' => $package, 'time' => floor($time / 10000) - 1];
|
|
|
|
|
|
+ if ($newestUpdate < $time + 10) {
|
|
|
|
+ $actions[$package] = ['type' => 'delete', 'package' => $package, 'time' => floor(($time - 2000) / 10000)];
|
|
unset($actions[$package.'~dev']);
|
|
unset($actions[$package.'~dev']);
|
|
}
|
|
}
|
|
}
|
|
}
|