Commit Graph

257 Commits

Author SHA1 Message Date
Roardom
285642f26e fix: ci 2023-09-08 03:04:26 +00:00
Roardom
9345ad6bb3 update: manually bencode the announce response
Performance optimization compared to recursively encoding one character at a time using the Bencode helper function.
2023-09-08 01:46:58 +00:00
Roardom
bc94c0ed5e update: cache torrents in announce by infohash 2023-09-07 03:37:09 +00:00
HDVinnie
b02991b284 Merge pull request #3117 from Roardom/treat-stop-differently-for-min-announce-enforcement
(Update) Delete min interval timer if stopped event
2023-09-05 21:03:18 -04:00
Roardom
f622a356b5 update: delete min interval timer if stopped event 2023-09-06 00:28:39 +00:00
Roardom
cb123390f3 fix: don't upsert peer connectable status
We calculate these asynchronously now.
2023-09-05 21:48:58 +00:00
Roardom
600f1ef3b0 fix: missing required selected columns
We need the `uploaded` and `downloaded` columns for the history calculations
2023-09-05 21:48:07 +00:00
HDVinnie
94cab6ac8f remove: announce dead code 2023-09-04 18:25:15 -04:00
HDVinnie
41417d8c07 Merge branch '7.x.x' into pr/3114 2023-09-04 12:35:04 -04:00
Roardom
cfa417de3b update: inline announce processing job into announce 2023-09-04 10:02:44 +00:00
Roardom
d7287b86cf fix: min interval enforcement
Arguments are in the wrong order
2023-09-01 07:12:33 +00:00
HDVinnie
f510d77cbb Merge branch '7.x.x' into announce-interval 2023-08-31 18:48:02 -04:00
HDVinnie
624e4f2b68 update: announce controller
- remove dead timestamp code
- decrease mix / max intervals
- simplify checkMinInterval function
2023-08-31 18:41:43 -04:00
HDVinnie
ffaa3452b1 update: announce controller
- return times_completed metric to user client
2023-08-31 18:35:18 -04:00
Roardom
82a368e25c update: improve peer min interval enforcement
Now that peers are only updated every 5 seconds, we need to cache their last announce timestamp in redis instead of relying on the updated_at timestamp in the database
2023-08-30 12:48:35 +00: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