Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add litestack configuration #3

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ gem "dry-types", "~> 1.7"
# Avo admin
gem "avo", ">= 3.2"
gem "ransack", "~> 4.1"

gem "litestack", "~> 0.4.2"
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ GEM
ffi (1.16.3)
globalid (1.2.1)
activesupport (>= 6.1)
hanami-router (0.6.2)
hanami-utils (~> 0.7)
http_router (~> 0.11)
hanami-utils (0.9.2)
heroicon (1.0.0)
rails (>= 5.2)
highline (3.0.0)
Expand All @@ -194,6 +198,9 @@ GEM
actioncable (>= 6.0.0)
listen (>= 3.0.0)
railties (>= 6.0.0)
http_router (0.11.2)
rack (>= 1.0.0)
url_mount (~> 0.2.1)
httparty (0.21.0)
mini_mime (>= 1.0.0)
multi_xml (>= 0.5.2)
Expand Down Expand Up @@ -246,6 +253,13 @@ GEM
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
litestack (0.4.2)
erubi
hanami-router
oj
rack
sqlite3
tilt
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand Down Expand Up @@ -291,6 +305,8 @@ GEM
racc (~> 1.4)
nokogiri (1.16.0-x86_64-linux)
racc (~> 1.4)
oj (3.16.3)
bigdecimal (>= 3.0)
pagy (6.4.1)
parallel (1.24.0)
parser (3.3.0.4)
Expand Down Expand Up @@ -439,6 +455,7 @@ GEM
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.3.0)
tilt (2.3.0)
timeout (0.4.1)
turbo-rails (2.0.0.pre.beta.2)
actionpack (>= 6.0.0)
Expand All @@ -449,6 +466,8 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
url_mount (0.2.1)
rack
view_component (3.10.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -496,6 +515,7 @@ DEPENDENCIES
jsbundling-rails
kamal
letter_opener
litestack (~> 0.4.2)
magic_test!
propshaft
puma (>= 5.0)
Expand Down
12 changes: 6 additions & 6 deletions config/cable.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
development:
adapter: redis
url: redis://localhost:6379/1
adapter: litecable

test:
adapter: test
adapter: litecable

staging:
adapter: litecable

production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: daisy_on_rails_production
adapter: litecable
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true

config.cache_store = :memory_store
config.cache_store = :litecache, {path: "./storage/cache.development.db"}
config.public_file_server.headers = {
"Cache-Control" => "public, max-age=#{2.days.to_i}"
}
Expand Down
4 changes: 4 additions & 0 deletions config/litecable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
path: "./storage/cable.db"

test:
path: "./storage/cable.test.db"
11 changes: 11 additions & 0 deletions config/litejob.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
path: "storage/queue.db" # where the database file resides
queues:
- [default, 1] # default queue with the lowest priority
- [urgent, 10, spawn] # this is not a default, a higher priority queue which will run every job in its own thread or fiber
workers: 5 # how many threads/fibers to spawn for queue processing
retries: 5 # how many times to retry a failed job before giving up
retry_delay: 60 # seconds
retry_delay_multiplier: 10 # 60 -> 600 -> 6000 and so on
dead_job_retention: 864000 # 10 days to keep completely faild jobs in the _dead queue
gc_sleep_interval: 7200 # 2 hours of sleep between checking for dead jobs that are ready to be buried forever
logger: STDOUT # possible values are STDOUT, STDERR, NULL or a file location