-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client()
method returns None when used outside of a hook context
#19
Comments
I was able to fix this by saving the installation id when I get the request, and then when the job is ready to execute, I do this: def do_job(..., installation_id):
with app.app_context():
client = ghapp.client(installation_id);
# do stuff Thinking about this it makes sense that I would need to save the installation Id aside somwhere, otherwise I wouldn't know which installation to act as. However, does the Anyway this might be a good example to put in the docs somewhere. Btw nice project! |
Hey qlyoung, Thank you very much for the filing the issue, we have the exact use case you are doing, and we implemented exactly what you did. The reason we would use If you try to create a client by doing If you're okay with this approach then I'd agree some documentation around the use case will be extremely beneficial. I'm glad you're finding the project useful! |
I think the approach is fine. Unfortunately I doubt I'll have much bandwidth to contribute a docs change in the near future. |
I have an application that reacts to webhooks by scheduling a task to execute at a future time (say, in 1 hour). At that time it needs to call the GH API to perform some action, so it needs a
GhApi
client. Despite the recent patch to allow getting a client outside of a hook context, when I do it, I getNone
. Works fine inside a hook context though.Any idea what I'm doing wrong? Is this supported?
The text was updated successfully, but these errors were encountered: