Page MenuHomePhabricator

Cache terminal width
ClosedPublic

Authored by joshuaspence on Jul 1 2015, 10:06 PM.
Tags
None
Referenced Files
F15411969: D13519.id.diff
Wed, Mar 19, 10:34 AM
F15389836: D13519.diff
Sat, Mar 15, 5:41 AM
Unknown Object (File)
Mon, Mar 3, 12:26 PM
Unknown Object (File)
Thu, Feb 20, 8:18 PM
Unknown Object (File)
Feb 11 2025, 9:36 PM
Unknown Object (File)
Feb 8 2025, 6:13 PM
Unknown Object (File)
Feb 8 2025, 6:12 PM
Unknown Object (File)
Feb 8 2025, 6:12 PM
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.