-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
apply Stephan workshop optimisation (#17)
* apply stephan workshop optimisation * lint
- Loading branch information
1 parent
57b5307
commit 0c014c1
Showing
23 changed files
with
445 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,18 @@ class Application < Rails::Application | |
# | ||
# config.time_zone = "Central Time (US & Canada)" | ||
# config.eager_load_paths << Rails.root.join("extras") | ||
|
||
# Use Solid Queue as the Active Job backend | ||
config.active_job.queue_adapter = :solid_queue | ||
config.solid_queue.connects_to = {database: {writing: :queue, reading: :queue}} | ||
|
||
# Use Solid Cache Store as the cache store | ||
config.cache_store = :solid_cache_store | ||
|
||
# Use a separate database for error monitoring | ||
config.solid_errors.connects_to = {database: {writing: :errors, reading: :errors}} | ||
# config.solid_errors.send_emails = true | ||
# config.solid_errors.email_from = "[email protected]" | ||
# config.solid_errors.email_to = "[email protected]" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Use this hook to configure the litestream-ruby gem. | ||
# All configuration options will be available as environment variables, e.g. | ||
# config.replica_bucket becomes LITESTREAM_REPLICA_BUCKET | ||
# This allows you to configure Litestream using Rails encrypted credentials, | ||
# or some other mechanism where the values are only avaialble at runtime. | ||
|
||
Litestream.configure do |config| | ||
# An example of using Rails encrypted credentials to configure Litestream. | ||
litestream_credentials = Rails.application.credentials.litestream | ||
|
||
# Replica-specific bucket location. | ||
# This will be your bucket's URL without the `https://` prefix. | ||
# For example, if you used DigitalOcean Spaces, your bucket URL could look like: | ||
# https://myapp.fra1.digitaloceanspaces.com | ||
# And so you should set your `replica_bucket` to: | ||
# myapp.fra1.digitaloceanspaces.com | ||
# Litestream supports Azure Blog Storage, Backblaze B2, DigitalOcean Spaces, | ||
# Scaleway Object Storage, Google Cloud Storage, Linode Object Storage, and | ||
# any SFTP server. | ||
# In this example, we are using Rails encrypted credentials to store the URL to | ||
# our storage provider bucket. | ||
config.replica_bucket = litestream_credentials&.replica_bucket | ||
|
||
# Replica-specific authentication key. | ||
# Litestream needs authentication credentials to access your storage provider bucket. | ||
# In this example, we are using Rails encrypted credentials to store the access key ID. | ||
config.replica_key_id = litestream_credentials&.replica_key_id | ||
|
||
# Replica-specific secret key. | ||
# Litestream needs authentication credentials to access your storage provider bucket. | ||
# In this example, we are using Rails encrypted credentials to store the secret access key. | ||
config.replica_access_key = litestream_credentials&.replica_access_key | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
default: &default | ||
database: cache | ||
store_options: | ||
max_age: <%= 1.week.to_i %> | ||
max_size: <%= 512.megabytes %> | ||
namespace: <%= Rails.env %> | ||
|
||
development: | ||
<<: *default | ||
|
||
test: | ||
<<: *default | ||
|
||
production: | ||
<<: *default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
db/cache_migrate/20240512200132_create_solid_cache_entries.solid_cache.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This migration comes from solid_cache (originally 20230724121448) | ||
class CreateSolidCacheEntries < ActiveRecord::Migration[7.0] | ||
def change | ||
create_table :solid_cache_entries do |t| | ||
t.binary :key, null: false, limit: 1024 | ||
t.binary :value, null: false, limit: 512.megabytes | ||
t.datetime :created_at, null: false | ||
|
||
t.index :key, unique: true | ||
end | ||
end | ||
end |
Oops, something went wrong.