Change mapping for redis container and add logs to export process

This commit is contained in:
Eugene Burmakin 2024-12-11 14:34:59 +01:00
parent b1c48076e4
commit 866b10ceca
3 changed files with 29 additions and 4 deletions

View file

@ -7,15 +7,34 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# 0.19.6 - 2024-12-11
⚠️ This release introduces a breaking change. ⚠️
The `dawarich_shared` volume now being mounted to `/data` instead of `/var/shared` within the container. It fixes Redis data being lost on container restart.
To change this, you need to update the `docker-compose.yml` file:
```diff
dawarich_redis:
image: redis:7.0-alpine
container_name: dawarich_redis
command: redis-server
volumes:
+ - dawarich_shared:/data
restart: always
healthcheck:
```
### Fixed
- Flash messages are now being removed after 5 seconds.
- Fixed broken migration that was preventing the app from starting.
- Visits page is now loading a lot faster than before.
- Redis data should now be preserved on container restart.
### Changed
- Places page is now accessible from the Visits & Places tab on the navbar.
- Exporting process is now being logged.
# 0.19.5 - 2024-12-10

View file

@ -18,7 +18,7 @@ class Exports::Create
create_export_file(data)
export.update!(status: :completed, url: "exports/#{export.name}.#{file_format}")
export.update!(status: :completed, url: "exports/#{export.name}")
create_export_finished_notification
rescue StandardError => e
@ -74,10 +74,16 @@ class Exports::Create
def create_export_file(data)
dir_path = Rails.root.join('public/exports')
Dir.mkdir(dir_path) unless Dir.exist?(dir_path)
file_path = dir_path.join("#{export.name}.#{file_format}")
FileUtils.mkdir_p(dir_path) unless Dir.exist?(dir_path)
file_path = dir_path.join(export.name)
Rails.logger.info("Creating export file at: #{file_path}")
File.open(file_path, 'w') { |file| file.write(data) }
rescue StandardError => e
Rails.logger.error("Failed to create export file: #{e.message}")
raise
end
end

View file

@ -8,7 +8,7 @@ services:
networks:
- dawarich
volumes:
- dawarich_shared:/var/shared/redis
- dawarich_shared:/data
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]