0

I have a object need to share globally in views.py like this:

import stuff 

api = Blueprint('app', __name__, template_folder='templates')
shared_object = load_prefix_tree()

@api.route("/")
def index():

.....

which would works as i expected. But i notice that shared_object would load twice after start service. It seems related to the context(application and request) switching. Is there any way to make it only load once cause the shared_object would take about 30 mins to load. Thanks.

davidism
  • 121,510
  • 29
  • 395
  • 339
Chandler.Huang
  • 873
  • 3
  • 12
  • 24

0 Answers0