pythonpython-3.xquarthypercorn

Python runs old functions


I have a project build with PY3 with Quart. I run it with hypercorn. I have deployed a new version, but when I post a request I get old response.

I did a simple test, and wrote a static response in one of my routes to see the change. Nothing. I have killed all my process and restarted them. I have restarted the server. Noting.

Started the app with python3 app.py, Same. What am I missing?

Here is a code example:

app.py

__package__ = 'nini'

from .setups import create_app

if __name__ == '__main__':
    app = create_app()
    app.run(host='127.0.0.1', debug=True)

test.py

from quart import jsonify, app, current_app
from quart_openapi import PintBlueprint
from datetime import datetime


results = PintBlueprint('test', __name__)


@results.route('/test/test')
async def get_tests():
    t = get_float_t(get_user_t())
    return jsonify(t), 200 

I have changed the function result of get_user_t function. After deploy I looked and the code was changed but I keep getting the old result. I cleaned all the pycache folders, build folders and egg files and run sudo pip3 install -e .

To test what's heppening I changed get_user_t route to this:

@results.route('/test/test')
async def get_tests():
    t = get_float_t(get_user_t())
    return jsonify('9999'), 200 

I still Get the old result.

Also cleared all


Solution

  • So it was permissions problem. For some reason the service was unable to create __pycache__ folders and files. It worked after I ran it as root.

    I know it's not a good idea to run a service as root, so I will work out the permissions problem.