diff --git a/.app_version b/.app_version index 699c6c6d..973334b4 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.1.8 +0.1.8.1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a5a80b..08413625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.1.8.1] — 2024-04-21 + +### Changed + +- Set Redis as default cache store + +### Fixed + +- Consider timezone when parsing datetime params in points controller +- Add rescue for check version service class + ## [0.1.8] — 2024-04-21 ### Added diff --git a/app/controllers/points_controller.rb b/app/controllers/points_controller.rb index ba1c3fc8..56c5b688 100644 --- a/app/controllers/points_controller.rb +++ b/app/controllers/points_controller.rb @@ -19,13 +19,13 @@ class PointsController < ApplicationController def start_at return 1.month.ago.beginning_of_day.to_i if params[:start_at].nil? - Time.parse(params[:start_at]).to_i + Time.zone.parse(params[:start_at]).to_i end def end_at return Time.zone.today.end_of_day.to_i if params[:end_at].nil? - Time.parse(params[:end_at]).to_i + Time.zone.parse(params[:end_at]).to_i end def distance diff --git a/app/services/check_app_version.rb b/app/services/check_app_version.rb index 745911f7..d6f1d4b6 100644 --- a/app/services/check_app_version.rb +++ b/app/services/check_app_version.rb @@ -7,7 +7,12 @@ class CheckAppVersion end def call - latest_version = JSON.parse(Net::HTTP.get(URI.parse(@repo_url)))[0]['name'] + begin + latest_version = JSON.parse(Net::HTTP.get(URI.parse(@repo_url)))[0]['name'] + rescue + return false + end + latest_version != @app_version end end diff --git a/config/environments/development.rb b/config/environments/development.rb index b81ce8d1..2f30c41e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -23,14 +23,14 @@ Rails.application.configure do config.action_controller.perform_caching = true config.action_controller.enable_fragment_cache_logging = true - config.cache_store = :memory_store + config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'] } config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" } else config.action_controller.perform_caching = false - config.cache_store = :null_store + config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'] } end # Store uploaded files on the local file system (see config/storage.yml for options). diff --git a/config/environments/production.rb b/config/environments/production.rb index 9fd8f41f..f541929a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -66,6 +66,7 @@ Rails.application.configure do # Use a different cache store in production. # config.cache_store = :mem_cache_store + config.cache_store = :redis_cache_store, { url: ENV['REDIS_URL'] } # Use a real queuing backend for Active Job (and separate queues per environment). # config.active_job.queue_adapter = :resque