I cannot disclose much of my code, the email was an example. I'm trying to access shotgun API and it seems that shotgun is the problem. No errors to show in console btw.
for example:
@flaskblueprint.route('/api/my_endpoint', methods=['POST'])
def my_endpoint():
print(">>> myendpoint got a request")
example_str= request.get_json()
t = Thread(target=do_something, args=(example_str, ))
t.start()
return rmsg.resp_msg(200, "Email sent")
def do_something(example_str):
print(example_str)
user = sg.find_one('HumanUser',[['id','is', xxx]],['login'])
print('PRINT THIS FROM SHOTGUN {}'.format(user))
That code would shot this in console when docker-compose
spawned uWSGI master process (pid: 1)
my-api | spawned uWSGI worker 1 (pid: 7, cores: 1)
my-api | spawned uWSGI worker 2 (pid: 8, cores: 1)
my-api | >>> myendpoint got a request
my-api | Hi
my-api | pid: 7|app: 0|req: 1/1] 172.21.0.1 () {34 vars in 525 bytes} [Tue Dec 22 07:15:26 2020] POST /api/my_endpoint => generated 40 bytes in 5 msecs (HTTP/1.1 200) 2 headers in 71 bytes (1 switches on core 0)
I did it in a python 3.8 azure web app, and it works. If I use a web app using containers or docker-compose locally, it won't and it doesn't give me any error.