Commit Graph

24 Commits

Author SHA1 Message Date
Peter Bhat Harkins b45d175083 add brakeman
Wrote ignore notes and specs for the security assumptions implied.
Removed TZ from moderations table; everything is Chicago time, best time.
2023-12-17 20:22:47 -06:00
Peter Bhat Harkins 237e219116 standardrb: add standard-sorbet 2023-09-14 08:45:21 -05:00
Peter Bhat Harkins c3f8625788 standardrb
I can't take Rubocop any more. Moving up to Ruby 3 forces us to update RuboCop,
and it comes with dozens of linters that I'd have to evaluate, none of which is
a marginal improvement. I'm done having opinions.
2023-09-08 15:39:50 -05:00
Peter Bhat Harkins ef642dff69 fix Keystore.value_for; add some guardrails to mail_new_activity
Really embarassing bug in e334ae. This returned the current traffic intensity
number for all queries (0-100) so this started sending the mailing list mode
users basically every story and comment from the dawn of time.
2022-03-19 17:02:07 -05:00
Peter Bhat Harkins e334ae41b4 perf improvements for traffic intensity
TrafficHelper's hot-path intensity does a single select for a single row and
loads the value rather than instantiate an ActiveRecord object.

Updating the intensity has moved entirely to the cron job to prevent dogpiling,
and does three upserts instead of select + upsert.

No more hassling around with different keys for intensity when we only use the
latest value.
2022-03-19 08:15:20 -05:00
Dmitry Shveikus 51d97aa359 Add validations into models (#745, #766) 2020-02-05 09:15:25 -06:00
Peter Bhat Harkins dfb4453275 replace traffic counting with measuring
No parameters that need tuning and a single select for most hits.
Logo intensity is based on traffic in the last 15m compared to the last 90
days, and that calculation is cached for 5m. Deliberately does not use
transactions: we don't need the correctness, and it's cheaper to overwrite
a couple times than lock Keystore. Addresses #536; will know in a week if it
closes.
2019-04-21 18:53:39 -05:00
Peter Bhat Harkins 9554e41cee rubocop: Metrics/LineLength, 71 2018-03-19 16:01:05 -05:00
Peter Bhat Harkins b8ad1c5c91 rubocop: Rails/Validation, 223 2018-03-19 10:00:27 -05:00
Peter Bhat Harkins d1ab72dfde rubocop: Rails/ApplicationRecord, 321 2018-03-18 19:12:01 -05:00
Peter Bhat Harkins 84689eded1 rubocop: Rails/FindBy, 607
Worth the change to use this little idiom.
2018-03-17 14:07:53 -05:00
Serge Paquet d74a2c448f add postgresql support 2014-01-14 21:42:27 -05:00
Serge Paquet 8fbf76b484 use activerecord query interface instead of deprecated finder methods 2013-12-25 16:43:50 -05:00
joshua stein d0459974cd so long whitespace 2013-02-13 18:50:51 -06:00
joshua stein 47f1c44fc9 do incremented_value_for in a transaction to make sure we get the right key back
do sqlite checks based on Keystore.connection.adapter_name rather
than assuming one environment uses sqlite and the others don't
2012-10-24 14:55:14 -05:00
joshua stein 6be5150bb0 cleanup 2012-09-04 20:59:51 -05:00
Maxwell Swadling 3c65a3332f Fixed the sqlite FIXME for keystore 2012-09-05 09:01:59 +10:00
joshua stein 95ef42d872 move confidence and hotness into sql tables for proper sorting 2012-08-24 11:41:34 -05:00
joshua stein 6b76eadcec sqlite is only in test 2012-08-24 10:57:42 -05:00
joshua stein 73916d6636 going to have to do this sqlite-specific anyway 2012-08-24 10:57:42 -05:00
joshua stein 8dd109c49f drop custom markdowner for rdiscount 2012-08-24 10:57:42 -05:00
joshua stein 578c96d653 more work 2012-06-30 14:14:35 -05:00
joshua stein 95b4906e6e working voting/scoring, threaded comments 2012-06-30 11:18:36 -05:00
joshua stein 093747b796 initial work on conversion from php tree 2012-06-16 20:15:46 -05:00