Roardom
26bdeca374
refactor: inline peer upsert array creation
...
Remove some code duplication.
2023-09-04 09:37:53 +00:00
Roardom
be0936af27
update: remove redundant peer update
...
The peer is already updated automatically through Laravel's upsert.
2023-09-04 09:36:48 +00:00
Roardom
dce02a6a7a
refactor: clarify that announce uploaded/downloaded are deltas
2023-09-04 09:36:15 +00:00
Roardom
7161b85a23
refactor: organize announce job if statement conditions
2023-09-04 09:35:01 +00:00
Roardom
13d3973220
update: change torrent seeder/leecher counts relatively
2023-09-04 09:34:41 +00:00
Roardom
31e7b73549
update: deconstruct announce job switch statement
2023-09-04 09:34:01 +00:00
HDVinnie
88d114c526
PHP Style Change (Laravel Pint CI)
2023-08-30 09:39:04 +00:00
Roardom
dd7c80012b
fix: upsert ordering
...
We want a queue and not a stack. I.e. first in first out, not first in last out.
2023-08-07 07:52:35 +00:00
HDVinnie
e89b90cec8
Merge pull request #3027 from Roardom/history-upsert-take-3
...
(Update) Upsert history records take 3
2023-08-06 21:35:28 -04:00
Roardom
d8dc3fd766
fix: downloaded announce logic
2023-08-05 05:52:19 +00:00
Roardom
5538be360e
Revert "Revert "update: don't fetch history record before updating it""
...
This reverts commit 0aed738cb7 .
2023-08-05 04:52:02 +00:00
Roardom
62f7bad6dc
fix: torrent seeder/leecher count
2023-08-04 18:46:47 +00:00
Roardom
0aed738cb7
Revert "update: don't fetch history record before updating it"
...
This reverts commit 6f795b07ea .
2023-08-02 01:54:15 +00:00
HDVinnie
9d2613e7b0
Merge pull request #2988 from Roardom/lowercase-event
...
(Update) Lowercase the announce event at beginning
2023-07-31 21:49:23 -04:00
HDVinnie
f776991059
Merge pull request #2975 from Roardom/update-history-upserts
...
(Update) Don't fetch history record before updating it
2023-07-31 21:48:43 -04:00
Roardom
9ed19c1593
update: lowercase the announce event at beginning
...
No need to keep converting it.
2023-07-30 01:20:11 +00:00
Roardom
6f795b07ea
update: don't fetch history record before updating it
2023-07-28 20:08:20 +00:00
HDVinnie
dc4b12963b
Merge branch '7.x.x' into fix-personal-fl-caching
2023-07-28 02:35:16 -04:00
Roardom
2f10728ec0
fix: personal freeleech caching
...
We're constantly querying for personal freeleech existence if we only store it when it's true.
2023-07-28 06:13:50 +00:00
Roardom
bb5255d968
Revert "update: cache personal freeleech existence instead of its value"
...
This reverts commit b48a9222d1 .
2023-07-28 06:08:55 +00:00
Roardom
4825ac53a2
fix: freeleech token caching
...
We're constantly querying for freeleech token existence if we only store it when it's true.
2023-07-28 06:05:39 +00:00
Roardom
b5246a0e80
Revert "fix: redundant fetching of records from the database"
...
This reverts commit 7d3a9e244e .
2023-07-28 05:21:31 +00:00
Roardom
2392da1310
Revert "fix: laravel default job model serialization"
...
This reverts commit 55d03d3819 .
2023-07-28 05:20:33 +00:00
Roardom
fa6ef2a65c
Revert "update: announce job"
...
This reverts commit 2524a978ab .
2023-07-28 05:20:31 +00:00
Roardom
624abb8644
Revert "fix: announce user update"
...
This reverts commit ef29310cd3 .
2023-07-28 05:20:28 +00:00
Roardom
ef29310cd3
fix: announce user update
2023-07-28 03:27:37 +00:00
HDVinnie
2524a978ab
update: announce job
2023-07-27 23:24:55 -04:00
Roardom
55d03d3819
fix: laravel default job model serialization
...
laravel by default automatically serializes models in a custom way when inserted into a job queue and fetches the model from the database again when the job is ran. We would rather not have these extra queries, so we can't pass in models, or data that is already serialized (as laravel will try to deserailize our serialization too and fail), so we opted for arrays, and filling in the properties into a new model again once the job is handled.
2023-07-27 03:11:04 +00:00
HDVinnie
3a26e4ae1c
PHP Style Change (Laravel Pint CI)
2023-07-26 04:23:48 +00:00
HDVinnie
0d31d20d8a
Merge branch '7.x.x' into fix-process-announce-selects
2023-07-26 00:22:46 -04:00
HDVinnie
b2a6bf1ac3
Merge pull request #2959 from Roardom/personal-freeleech-ttl
...
(Update) Cache personal freeleech existence instead of its value
2023-07-25 23:19:48 -04:00
HDVinnie
282dfb272d
fix: ProcessAnnounce.php
...
- was accidentally removed by me in https://github.com/HDInnovations/UNIT3D-Community-Edition/pull/2565
2023-07-25 23:19:22 -04:00
Roardom
88d6ae1d89
fix: ci
2023-07-26 02:39:44 +00:00
Roardom
7d3a9e244e
fix: redundant fetching of records from the database
...
The `SerializesModels` trait fetches a new copy of the record from the database, causing 4 more queries than we thought we were using. This change reduces the query time in the ProcessAnnounce job by 55%.
2023-07-26 02:18:20 +00:00
Roardom
b48a9222d1
update: cache personal freeleech existence instead of its value
...
We only cache it if it exists, so let's not query it every single time it doesn't exist.
We don't remove it from the hourly run command yet so that currently existing freeleeches can be deleted.
2023-07-25 22:48:56 +00:00
HDVinnie
5a3c3de9eb
update: peers upsert
2023-07-24 13:22:43 -04:00
HDVinnie
f8b9b3c80c
Merge branch '7.x.x' into active-peers
2023-07-24 13:04:12 -04:00
HDVinnie
d16bafc1e1
update: ProcessAnnounce.php
2023-07-24 12:57:21 -04:00
HDVinnie
61fccdc778
Merge branch '7.x.x' into Redis-Peer-Batching
2023-07-24 12:52:43 -04:00
Roardom
10c146d217
add: peer active status
...
Mark peers for deletion via this column so that they can be mass deleted later. This allows for combining peer inserts, updates and deletions into a single bulk peer upsert queue. Otherwise, when a user stops and starts a torrent before the bulk peer updates are collected in the queue, the peer may be deleted immediately after it gets inserted.
2023-07-23 00:42:45 +00:00
Roardom
f26f82bc17
fix: immune status on bulk history upsert
2023-07-20 07:02:56 +00:00
Roardom
e1505c86ad
fix: redis history batching
...
We need to make sure default values are provided instead of null.
2023-07-19 06:00:59 +00:00
Roardom
6ea7d8af69
add: redis history batching
2023-07-18 09:46:37 +00:00
Roardom
9d4789ba91
refactor: require whitespace before statements
2023-07-07 00:27:13 +00:00
HDVinnie
106484f14b
update: upsert
...
- history still needs too be made to upsert
- connectable logic needs updating
- $peer->delete() in job needs to be reworked
The only solution would be to instead of deleting it on stopped event, make another column on the peers table for is_active and update is_active to 1 in every case except for stopped, in which case update it to 0 instead of deleting and then a cron job can delete it later.
Co-Authored-By: Roardom <78790963+Roardom@users.noreply.github.com >
2023-07-02 23:32:42 -04:00
HDVinnie
93b2b46f27
Merge branch '7.x.x' into Redis-Peer-Batching
2023-05-26 12:13:32 -04:00
HDVinnie
3cf9fd6425
Merge pull request #2707 from Roardom/fix-stopped-event
...
(Fix) Stopped event not decreasing torrent seeders/leechers
2023-04-21 04:47:13 -04:00
HDVinnie
f82fe55304
update: announce job
...
- close #2709
2023-04-20 09:06:29 -04:00
Roardom
0c4f4becfb
fix: stopped event not decreasing torrent seeders/leechers
2023-04-20 09:14:49 +00:00
Roardom
e812ef4340
update: only update the torrents table a max of once per announce
2023-04-16 00:52:54 +00:00