radames commited on
Commit
213e233
β€’
1 Parent(s): cd4aa38

disable reloader

Browse files
Files changed (2) hide show
  1. .gitignore +4 -1
  2. app.py +5 -3
.gitignore CHANGED
@@ -25,4 +25,7 @@ htmlcov/
25
  *,cover
26
  venv
27
  *_cache.json
28
- data
 
 
 
 
25
  *,cover
26
  venv
27
  *_cache.json
28
+ data
29
+ prompts.db
30
+ static/data.json
31
+ static/images
app.py CHANGED
@@ -99,6 +99,7 @@ def push():
99
  else:
100
  return "Error", 401
101
 
 
102
  @app.route('/data')
103
  def getdata():
104
  return app.send_static_file('data.json')
@@ -123,10 +124,11 @@ def create():
123
  if __name__ == '__main__':
124
  mode = os.environ.get('FLASK_ENV', 'production')
125
  print(mode)
126
- if mode != 'development':
 
127
  scheduler = APScheduler()
128
  scheduler.add_job(id='Update Dataset Repository',
129
- func=update_repository, trigger='interval', seconds=300)
130
  scheduler.start()
131
  app.run(host='0.0.0.0', port=int(
132
- os.environ.get('PORT', 7860)), debug=True)
 
99
  else:
100
  return "Error", 401
101
 
102
+
103
  @app.route('/data')
104
  def getdata():
105
  return app.send_static_file('data.json')
 
124
  if __name__ == '__main__':
125
  mode = os.environ.get('FLASK_ENV', 'production')
126
  print(mode)
127
+ dev = mode == 'development'
128
+ if not dev:
129
  scheduler = APScheduler()
130
  scheduler.add_job(id='Update Dataset Repository',
131
+ func=update_repository, trigger='interval', seconds=300)
132
  scheduler.start()
133
  app.run(host='0.0.0.0', port=int(
134
+ os.environ.get('PORT', 7860)), debug=True, use_reloader=dev)