Skip to content

Commit

Permalink
fix(zlib): fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nicklassundin committed Dec 18, 2024
1 parent 49a5dea commit 69f0821
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions python/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
# Initialize Redis connection
import logging
logging.basicConfig(level=logging.INFO)
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)


lua_script = """
local keys = redis.call('KEYS', '*')
for i, key in ipairs(keys) do
Expand Down
4 changes: 2 additions & 2 deletions python/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,9 +321,9 @@ def get_stations(flush=False):
def get_all_stations():
flush = request.args.get('flush') == 'true'
stations_generator = get_stations(flush)
total_stations = sum(1 for _ in stations_generator) # Count the total number of stations
#total_stations = sum(1 for _ in stations_generator) # Count the total number of stations
def generate():
yield jsonify({'total_stations': total_stations}).data.decode('utf-8') + '\n' # Convert to JSON string and add newline for streaming
#yield jsonify({'total_stations': total_stations}).data.decode('utf-8') + '\n' # Convert to JSON string and add newline for streaming
for station in stations_generator:
yield jsonify(station).data.decode('utf-8') + '\n' # Convert to JSON string and add newline for streaming

Expand Down

0 comments on commit 69f0821

Please sign in to comment.