From 8733bb8078f7c5d79582dfdd177db306cbc3c9e9 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 16 May 2018 08:54:55 +0200 Subject: [PATCH] fix #1766: compare task starttime numerically Not only because <=> is correct, but using 'cmp' also has the side effect that it adds a string version to the variable and the API's json output turns into a string as well, and this only happens once a task has completed (while it's an integer while it's still running...) Signed-off-by: Wolfgang Bumiller --- src/PVE/RESTEnvironment.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm index ebf8a2e..32ffdd1 100644 --- a/src/PVE/RESTEnvironment.pm +++ b/src/PVE/RESTEnvironment.pm @@ -270,7 +270,7 @@ sub active_workers { } - @ta = sort { $b->{starttime} cmp $a->{starttime} } @ta; + @ta = sort { $b->{starttime} <=> $a->{starttime} } @ta; my $save = defined($new_upid); -- 2.39.2