mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-10-31 15:12:25 +00:00 
			
		
		
		
	wa/misc: Fix format_duration() to handle missing time
If a run is interrupted this can cause the time to be `None` causing an error, if this is the case then set time to 0 and therefore return `N/A`.
This commit is contained in:
		| @@ -247,7 +247,7 @@ def format_duration(seconds, sep=' ', order=['day', 'hour', 'minute', 'second']) | |||||||
|     if isinstance(seconds, timedelta): |     if isinstance(seconds, timedelta): | ||||||
|         td = seconds |         td = seconds | ||||||
|     else: |     else: | ||||||
|         td = timedelta(seconds=seconds) |         td = timedelta(seconds=seconds or 0) | ||||||
|     dt = datetime(1, 1, 1) + td |     dt = datetime(1, 1, 1) + td | ||||||
|     result = [] |     result = [] | ||||||
|     for item in order: |     for item in order: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user