mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Change mapping for redis container and add logs to export process
This commit is contained in:
parent
b1c48076e4
commit
866b10ceca
3 changed files with 29 additions and 4 deletions
19
CHANGELOG.md
19
CHANGELOG.md
|
|
@ -7,15 +7,34 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
# 0.19.6 - 2024-12-11
|
# 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
|
### Fixed
|
||||||
|
|
||||||
- Flash messages are now being removed after 5 seconds.
|
- Flash messages are now being removed after 5 seconds.
|
||||||
- Fixed broken migration that was preventing the app from starting.
|
- Fixed broken migration that was preventing the app from starting.
|
||||||
- Visits page is now loading a lot faster than before.
|
- Visits page is now loading a lot faster than before.
|
||||||
|
- Redis data should now be preserved on container restart.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Places page is now accessible from the Visits & Places tab on the navbar.
|
- 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
|
# 0.19.5 - 2024-12-10
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class Exports::Create
|
||||||
|
|
||||||
create_export_file(data)
|
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
|
create_export_finished_notification
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
|
|
@ -74,10 +74,16 @@ class Exports::Create
|
||||||
|
|
||||||
def create_export_file(data)
|
def create_export_file(data)
|
||||||
dir_path = Rails.root.join('public/exports')
|
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) }
|
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- dawarich
|
- dawarich
|
||||||
volumes:
|
volumes:
|
||||||
- dawarich_shared:/var/shared/redis
|
- dawarich_shared:/data
|
||||||
restart: always
|
restart: always
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue