Commit Graph

243 Commits

Author SHA1 Message Date
HDVinnie
ffaa3452b1 update: announce controller
- return times_completed metric to user client
2023-08-31 18:35:18 -04:00
Roardom
8127734979 fix: various larastan command issues 2023-08-25 07:58:38 +00:00
Roardom
21de4f2047 fix: race condition in download slot limit 2023-08-13 11:12:13 +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
Roardom
9ed19c1593 update: lowercase the announce event at beginning
No need to keep converting it.
2023-07-30 01:20:11 +00:00
Roardom
c554e29abe update: keep peers that stopped announcing for longer
Now that we upsert history records without first selecting them, we can't rely on storing a peer's last uploaded/downloaded values in the history record to determine the user's uploaded/downloaded delta between the last announce. If a user has internet issues for a brief period of time but their client continues working, then their change of upload/download between the two announces needs to be kept track of. This is usually kept track of in the peer record, but if the peer is deleted after 2 hours of not announcing, then their last uploaded/downloaded data is deleted with it. We previously stored this data in the history table to handle such cases but this became erroneous if the user had multiple peers on a torrent. This new solution keeps the peers in the database for 2 days before concluding that the peer isn't coming back and deletes the peer permanently. After which point, a new peer will be created and an assumption is made that they uploaded/downloaded 0 data within their downtime.
2023-07-29 05:12:35 +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
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
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
eca50b5224 update: use prepared statement instead of eager loading peers 2023-07-23 09:16:44 +00:00
Roardom
0ffeb4fcf5 fix: missing include in announce controller 2023-07-10 20:44:22 +00:00
Roardom
741adef615 add: moderation scopes 2023-07-10 04:20:40 +00:00
Roardom
9d4789ba91 refactor: require whitespace before statements 2023-07-07 00:27:13 +00:00
Roardom
b5493c5642 refactor: swap where('id', '=', ) for find() 2023-06-19 23:18:40 +00:00
HDVinnie
19827844fd fix: #2715 2023-05-14 17:00:54 -04:00
Roardom
b52bffc728 refactor: reduce unnecessary collection calls 2023-04-09 00:06:47 +00:00
Roardom
4ec1fd5ad4 update: cache torrent infohash to id mapping 2023-04-08 17:23:25 +00:00
Roardom
ea9fd6c9c9 update: swap infohash from ascii-encoded hex to binary 2023-04-08 08:02:04 +00:00
HDVinnie
f4ebee885c update: lint 2023-02-03 22:23:00 -05:00
HDVinnie
3650900c97 update: lint
- not_operator_with_space to false
2023-02-03 16:01:29 -05:00
HDVinnie
472c820f99 update: UNIT3D linting
- github action updated with new ruleset in pint.json
- codebase linted with new ruleset
- contributors can now run `./vendor/bin/pint`
- action workflow will auto correct any lint issues upon commit/opened pull request
2023-02-02 08:02:34 -05:00
HDVinnie
315609a74b optimize: announce 2023-01-29 11:16:22 -05:00
HDVinnie
2ad4a06161 update: announce 2023-01-23 21:44:50 -05:00
HDVinnie
ab7fab7485 update: announce 2023-01-23 14:36:56 -05:00
HDVinnie
5d3762de20 PSR12 Linting 2023-01-18 03:02:18 +00:00
HDVinnie
b044cbc92c update: working optimized announce 2023-01-17 22:01:28 -05:00
HDVinnie
ef85ae3c51 update: announce controller 2023-01-09 00:47:56 -05:00
HDVinnie
4da8bc29de PSR12 Linting 2023-01-05 07:54:08 +00:00
Roardom
0ee2181e87 update: only cache announce denied groups once 2023-01-04 22:54:36 -06:00
Roardom
985423e267 update: announce 2023-01-04 05:46:02 -06:00
HDVinnie
4291b83864 optimize: announce 2023-01-03 21:12:21 -05:00
Roardom
22a8c7d29b update: peers table 2022-12-22 14:59:23 -06:00
HDVinnie
651ea72779 update: check for invalid requests 2022-11-11 12:47:49 -05:00
Roardom
1cc58726b6 update: reduce database queries used to retrieve peers 2022-10-30 20:54:01 -05:00
HDVinnie
ce8f986000 Merge branch '6.x.x' into fork/client-blacklist-db 2022-09-20 00:14:38 -04:00
HDVinnie
f6bf6a326e PSR12 Linting 2022-09-11 23:54:18 +00:00
HDVinnie
2ca429c4ce Revert "PSR12 Linting"
This reverts commit 7e65e1d589.
2022-09-11 19:51:58 -04:00
HDVinnie
7e65e1d589 PSR12 Linting 2022-09-11 23:50:41 +00:00
HDVinnie
fbf16412e3 refactor: fixes and updates
- still need to add lang and test
2022-09-07 10:12:13 -04:00
Jay Sizzla
32c448e99b add client blacklist from DB 2022-09-07 08:45:10 +02:00
HDVinnie
4d527a4b8c update: queue announce jobs w/ uniqueId 2022-08-22 22:01:08 -04:00
HDVinnie
c9e3510378 update: announce
- use eloquent
2022-08-21 00:38:35 -04:00
HDVinnie
ad910b3832 update: announce 2022-08-21 00:04:48 -04:00
HDVinnie
314a4a6588 revert: announce cache 2022-08-18 21:49:31 -04:00
HDVinnie
76283bac0f update: announce 2022-08-18 19:44:26 -04:00
HDVinnie
8ed3b2e0f2 update: announce 2022-08-17 22:45:36 -04:00
HDVinnie
a6d651c92a fix: casting issues 2022-08-09 23:41:51 -04:00
StyleCI Bot
885a070946 Apply fixes from StyleCI 2022-08-10 01:36:13 +00:00
HDVinnie
b4ec5a1cad update: announce controller 2022-08-09 21:35:32 -04:00