Page MenuHomeSoftware Heritage

server: Define make_app_from_configfile so it can be ran by gunicorn
ClosedPublic

Authored by vlorentz on Jul 27 2021, 5:36 PM.

Details

Summary

This required a minor Backend refactoring to make it work
without context managers.

Diff Detail

Event Timeline

Build is green

Patch application report for D6030 (id=21802)

Rebasing onto bb1ac27436...

Current branch diff-target is up to date.
Changes applied before test
commit 90d1109c510312b583d16aadcc3752317aa62b03
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date:   Tue Jul 27 17:36:36 2021 +0200

    server: Define make_app_from_configfile so it can be ran by gunicorn
    
    This required a minor Backend refactoring to make it work
    without context managers.

See https://jenkins.softwareheritage.org/job/DGRPH/job/tests-on-diff/130/ for more details.

Changes look sensible from afar but I don't know that part well so...

swh/graph/backend.py
38

Not per say related to this diff but still worth the remark and since you are modifying it...

Could you please add a docstring on this class to explain rapidly a bit what is its job?

Is it some kind of proxy forwarding requests to the actual java graph service or something?

swh/graph/server/app.py
362

Couldn't backend be a constructor argument of GraphServerApp to make clearer the collaborator relationship in the RPC class GraphServerApp?

(maybe not due to the @staticmethod in GraphServerApp though...)

swh/graph/backend.py
38

tbh I'm not sure

swh/graph/server/app.py
362

I don't know.

I think @seirl wants to rewrite this, anyway

This revision is now accepted and ready to land.Jul 29 2021, 11:52 AM