5

Reduce stat(2) calls by nobu · Pull Request #37265 · rails/rails · GitHub

 3 years ago
source link: https://github.com/rails/rails/pull/37265
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Contributor

nobu commented on Sep 22, 2019

Summary

File.file? and other predicates for permissions can use same stat(2) call result.

Copy link

Contributor

nateberkopec commented 18 days ago

Hmmm... since ActionDispatch::Static is based around this:

def call(env)
  @file_handler.attempt(env) || @app.call(env)
end

... this change causes any request that is not for a static file to raise 5-10 exceptions that are silently rescued. I think the original code is probably faster for requests handled by the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK