Fix timeout units and index stats width - #329
Draft
tanmay-9 wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
--timeoutofqlever startis passed on to the server, which accepts a unit (ns,us,ms,s,min,h). The commands that need the timeout seconds as a plain number, however, obtained it by cutting off the last character of the string, so anything but seconds broke them.With this change,
--timeoutis validated when it is parsed, so an unusable value is rejected right away, with a message naming the units that are accepted, instead of failing later in whichever command happens to need a number. The conversion to whole seconds now happens in one place for all commands, and a sub-second timeout becomes one second rather than zero, so it stays a timeout.On the side, the headings of
qlever index-statsare now padded to the width of the longest heading (at least the previous 25 characters, so the QLever output is unchanged) and to the same width in the time and the space part, so that the colons still line up for engines whose phases and file groups have longer names.