Page MenuHomePhabricator

Cache terminal width
ClosedPublic

Authored by joshuaspence on Jul 1 2015, 10:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 25, 12:06 PM
Unknown Object (File)
Fri, Jan 24, 7:07 AM
Unknown Object (File)
Fri, Jan 24, 7:07 AM
Unknown Object (File)
Fri, Jan 24, 7:06 AM
Unknown Object (File)
Tue, Jan 14, 7:01 AM
Unknown Object (File)
Sun, Jan 12, 3:12 PM
Unknown Object (File)
Dec 19 2024, 4:53 PM
Unknown Object (File)
Dec 9 2024, 11:39 AM
Tokens
"Like" token, awarded by yelirekim.

Details

Summary

This maybe fixes T8576. Whilst running ./bin/search index --all I noticed that I ended up with 159,596 temporary directory which I believe are due to phutil_console_get_terminal_width() running too often.

Test Plan

N/A

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Cache terminal width.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

Technically, we should listen for SIGWINCH (I think) and dirty this cache (because the user may resize the console while running the command), but this behavior is clearly worlds better than the prior behavior.

This revision is now accepted and ready to land.Jul 1 2015, 10:08 PM
This revision was automatically updated to reflect the committed changes.

Possibly we should do some false vs null stuff so that we cache "it didn't work", too, but whatevs.

Let's see if I can repopulate Elasticsearch in less than 48 hours now.