Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Don't sort an empty file list #2

Closed
wants to merge 1 commit into from

Conversation

MaxSem
Copy link

@MaxSem MaxSem commented Jan 31, 2017

sort just waits for stdin forever

Closes #1

Bug: T145534

return sortFile(tempFiles2, cleanupList);
}).then(function (sortedFile) {
cleanupList.push(sortedFile);
return addJobsFromSortedFile(sortedFile, options, addJobCallback);
}).then(function (result) {
core.log('info', 'Finished job creation... no more unemployment... at least for a bit');
return result;
}).catch(function() {
core.log('info', 'All tiles filtered out, nothing to process');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think catching and ignoring all errors is good. Its better to explicitly handle it by returning false or null, and handling it.

@MaxSem
Copy link
Author

MaxSem commented Feb 10, 2017

Updated.

@nyurik
Copy link
Member

nyurik commented Feb 12, 2017

I'm a bit confused - you still throw an exception if the sort list is empty, but you handle it later too?

sort just waits for stdin forever

Closes #1

Bug: T145534
@MaxSem
Copy link
Author

MaxSem commented Feb 13, 2017

The check in sortFile() is needed to prevent any reoccurences in the future - this function can still hang if called with empty list.

@MaxSem
Copy link
Author

MaxSem commented Feb 14, 2017

Resolved by @nyurik in 4186abc.

@MaxSem MaxSem closed this Feb 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants