]> git.proxmox.com Git - pve-common.git/commitdiff
fix #1766: compare task starttime numerically
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 16 May 2018 06:54:55 +0000 (08:54 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 May 2018 13:01:58 +0000 (15:01 +0200)
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 <w.bumiller@proxmox.com>
src/PVE/RESTEnvironment.pm

index ebf8a2e7aaaadc8e88b50929b8f15e6e00e98dbd..32ffdd157f48a898697f77f7b582df471c5f6f64 100644 (file)
@@ -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);
 
 
        my $save = defined($new_upid);