3030a53819
FIX: Prevent concurrent updates to top_topics ( #19854 )
...
to prevent lock timeouts
2023-01-12 14:03:26 -06:00
5a003715d3
DEV: Apply syntax_tree formatting to app/*
2023-01-09 14:14:59 +00:00
7b45a5ce55
FIX: Better and more secure validation of periods for TopicQuery
...
Co-authored-by: Martin Brennan <mjrbrennan@gmail.com >
2021-07-23 14:24:44 -04:00
427d54b2b0
DEV: Upgrading Discourse to Zeitwerk ( #8098 )
...
Zeitwerk simplifies working with dependencies in dev and makes it easier reloading class chains.
We no longer need to use Rails "require_dependency" anywhere and instead can just use standard
Ruby patterns to require files.
This is a far reaching change and we expect some followups here.
2019-10-02 14:01:53 +10:00
30990006a9
DEV: enable frozen string literal on all files
...
This reduces chances of errors where consumers of strings mutate inputs
and reduces memory usage of the app.
Test suite passes now, but there may be some stuff left, so we will run
a few sites on a branch prior to merging
2019-05-13 09:31:32 +08:00
152238b4cf
DEV: Prefer public_send
over send
.
2019-05-07 09:33:21 +08:00
5f64fd0a21
DEV: remove exec_sql and replace with mini_sql
...
Introduce new patterns for direct sql that are safe and fast.
MiniSql is not prone to memory bloat that can happen with direct PG usage.
It also has an extremely fast materializer and very a convenient API
- DB.exec(sql, *params) => runs sql returns row count
- DB.query(sql, *params) => runs sql returns usable objects (not a hash)
- DB.query_hash(sql, *params) => runs sql returns an array of hashes
- DB.query_single(sql, *params) => runs sql and returns a flat one dimensional array
- DB.build(sql) => returns a sql builder
See more at: https://github.com/discourse/mini_sql
2018-06-19 16:13:36 +10:00
5012d46cbd
Add rubocop to our build. ( #5004 )
2017-07-28 10:20:09 +09:00
b889bfefbb
PERF: Don't calculate the same query twice.
2016-11-24 14:05:26 +08:00
857955dd04
Follow our convention of declaring private methods.
2016-11-24 10:26:39 +08:00
f812415c52
Update annotations.
2016-11-24 10:13:03 +08:00
1cee914565
FEATURE: make top criteria formula multipliers controlled by site
...
setting
2016-01-21 10:30:06 +05:30
97e4f7f6d3
Enums that are used in tables need to be stable
2016-01-08 20:43:11 +05:30
fe656fb04d
FIX: select appropriate period when redirecting to top
2015-09-21 20:28:20 +02:00
7518918b8f
FEATURE: add quarterly period to Top page
2015-07-28 12:31:42 -04:00
2a586d59e9
FEATURE: top topics all time
...
tweak top algorithm (we will continue next week)
2015-03-06 18:00:29 +11:00
7edb88a5a8
FIX: change top score formula
...
Adds more weight to `likes` (it's now the same weight as `post_count`)
2014-12-03 11:51:49 +01:00
378bc6e5dc
private methods need to be called as method_name instead of ClassName#method_name
2014-10-04 09:53:46 +05:30
9524b514c6
Fix access specifiers with private_class_methods instead of removing directly
2014-10-04 09:20:41 +05:30
9d11ccc42e
removed usless access modifiers specified in models
2014-08-19 07:28:21 +05:30
a62968c846
FIX: actually compute top score for 'older' periods
2014-08-12 19:42:46 +02:00
cb0ecd9ff1
PERF: store topic views in a topic view table
...
* cut down on storage of the work Topic, 3 times per row (in 2 indexes)
* only store one view per user per topic
* only store one view per ip per topic
2014-08-04 19:07:55 +10:00
0a2036a99a
OPTIMIZATION: Don't run 12 queries every 15 mins for the Top section.
...
Instead, run the daily queries once every hour, and the reset of the
queries once a day.
2014-08-01 16:25:20 -04:00
f20fba041c
BUGFIX: improved top ranking formula (+ filter topics based on their creation date)
2014-05-05 23:05:35 +02:00
6373de550f
update annotations
2014-04-08 17:35:44 +02:00
b7ff4173c9
BUGFIX: mitigate unbound table growth on top_topics
2014-03-27 15:43:24 +11:00
084f51b013
FEATURE: do not show category definition topic on top pages
2014-03-07 12:02:52 +01:00
6b83ed0347
OPTIM: change Top Topic's score computation algorithm
...
New algorithm will not wipe the entire table anymore and will only remove
invisible topics and add new visible topics.
2014-02-28 20:33:52 +01:00
be560d4eb6
Update annotations
2014-02-07 11:07:52 +11:00
871adc0b0f
BUGFIX: Top page wasn't display any topics
2014-01-07 00:37:14 +01:00
fd36fa1c2f
make sure we do not count system user's posts
2014-01-03 17:27:55 +01:00
2cecc0b21f
make sure we only count regular posts when calculating Top score
2014-01-03 16:56:03 +01:00
28bf78d801
BUGFIX: make sure we only show topics that have a useful score in the Top page
2014-01-03 09:15:10 +01:00
edc154251d
FEATURE: improve the TOP page scoring formula a bit
2014-01-02 22:38:35 +01:00
1781b290cb
Fix top_topic.rb to be compatible with ruby 1.9
2013-12-27 16:16:25 -05:00
b5a59c10d5
let's try another formula for the top tab
2013-12-27 19:12:53 +01:00
9c8e50351d
first stab at calculating the score of a topic for the top tab
2013-12-27 18:10:35 +01:00
567d2bd23c
add top page
2013-12-24 00:50:36 +01:00