Commit Graph

10 Commits

Author SHA1 Message Date
Free Speech Forever
92c9092abd Avoid redundant OAuth queries when not signed in
If you aren't signed in, you don't have an auth token.
When you don't have an auth token, React was sending the headers

"Authorization: Bearer null"

This caused 5 Doorkeeper token lookups using
WHERE "oauth_access_tokens"."token" = 'null'
on the Explore page (the root of the app when not signed in).
2021-02-15 23:26:00 +00:00
rubic0n
f472a6154e Mark the replicas as replicas
Rails won't even attempt to write to a replica. Without this option,
a write attempt would actually run against Postgres, and it would
be up to Postgres to throw a readonly error.

Additionally, marking it as a replica teaches ActiveRecord that it
should not attempt to run migrations against this connection.

https://api.rubyonrails.org/classes/ActiveRecord/DatabaseConfigurations.html#method-i-configs_for

I'm actually pretty sure that the lack of `replica: true`
is why there's currently a db/slave1_schema.rb and db/slave2_schema.rb
2021-02-13 23:20:43 -06:00
rubic0n
903b6c7969 Simplify database.yml by merging in default options
Anything in the &default section can be merged in using <<: *default
In this case, the default already specifies that the adapter is
postgresql, the timeout is 5000, the encoding is unicode. It also
already specified the db pool, but the default actually checked 2
different ENVs and provided a fallback if it's not provided.
Lastly, I was able to move the prepared_statements section to the
defaults, because the .env.vagrant file doesn't specify
ENV['PREPARED_STATEMENTS'], development still just sets it to
'false'.
2021-02-13 23:20:43 -06:00
Fosco Marotto
729c00a5a9 Bundle of corrections and one doorkeeper writing role change 2021-02-09 22:32:24 -05:00
admin
382fd31ec7 Update database.yml 2021-02-09 19:41:12 +00:00
Free Speech Forever
473c48b2aa Replace Makara with an initial Rails 6 role based splitting method. 2021-02-09 19:38:10 +00:00
rubic0n
2952c9f59d Simplify db config 2021-01-24 23:57:30 -06:00
rubic0n
70c29c6cbd Fix "ERR! error: password authentication failed for user "vagrant"" 2021-01-23 09:00:35 -06:00
Fosco Marotto
818a9910c1 [database.yml] Use makara in development too 2020-12-27 01:59:24 -05:00
robcolbert
bd0b5afc92 Gab Social. All are welcome. 2019-07-02 03:10:25 -04:00