Hello, this is my first time trying to use a cloud service to host my own project and I'm having some trouble with handling the deploying and having my code work properly.
Context: I build a simple messaging Bot (T*l*gram) that uses AI to handle incoming messages. I had the bot working on my development machine where I was able to interact with it in the T*l*gram client. I decided to move it to the Cloud to handle the 24/7 hosting that I want for this application. I've pinpointed Cloud Functions as the service I'd like to use from Google Cloud. I walked through the Quickstart to get an idea of how it works, thankfully it's not too complicated. I'm encountering a problem with the final deployment that comes after a successful build.
Source Code:
Now, I need to define an entry point for Cloud Functions and uncovered that I would need to add that to my code with the use of the flask and functions_framework libraries like so,
@functions_framework.http
def hello(request: flask.Request) -> flask.typing.ResponseReturnValue:
return "Hello, world!"
So as you can my bot is originally polling in order to wait for requests and forward those to the single handler. I think this is where my deployment is getting stuck because the build succeeds but past that the deployment fails as it seems to be hanging for a prolonged period of time. I tried local testing the deployment like so,
$ functions-framework --target hello --source ./main.py --debug
and from here I see that the text that would pop up in the console to confirm that the server has started as one would see when starting up a flask server -- doesn't show up because the bot is already polling.
I've tried hacking something where I stick the polling function inside the entry point route but that doesn't work. Any help is greatly appreciated, and if this seems like a noob question, you're probably right.