On 5/16/18 8:54 AM, Wolfgang Bumiller wrote:
> 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.bumil...@proxmox.com>
> ---
>  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);
>  
> 


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to