Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
174
Issues
174
List
Boards
Labels
Service Desk
Milestones
Merge Requests
43
Merge Requests
43
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
2f37b154
Commit
2f37b154
authored
14 minutes ago
by
Ben Hayward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added in config for max
parent
3817cb1f
feat/rate-limit-boost-475
1 merge request
!251
[Sprint/InterestingIguana](feat): Offchain boost rate limiting #475
Pipeline
#72136978
canceled with stages
in 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
boost.php
Controllers/api/v2/boost.php
+2
-1
Manager.php
Core/Boost/Network/Manager.php
+3
-1
settings.example.php
settings.example.php
+3
-0
No files found.
Controllers/api/v2/boost.php
View file @
2f37b154
...
...
@@ -298,9 +298,10 @@ class boost implements Interfaces\Api
}
if
(
$manager
->
boostLimitReached
(
$boost
))
{
$maxDaily
=
Di
::
_
()
->
get
(
'Config'
)
->
get
(
'max_daily_boost_views'
);
return
Factory
::
response
([
'status'
=>
'error'
,
'message'
=>
"This boost would exceeded the maximum of
10
offchain tokens per day."
'message'
=>
"This boost would exceeded the maximum of
"
.
$maxDaily
.
"
offchain tokens per day."
]);
}
...
...
This diff is collapsed.
Click to expand it.
Core/Boost/Network/Manager.php
View file @
2f37b154
...
...
@@ -177,7 +177,9 @@ class Manager
$acc
+=
$_boost
->
getImpressions
();
return
$acc
;
});
return
$acc
+
$boost
->
getImpressions
()
>
10000
;
//still allow 10k
$maxDaily
=
Di
::
_
()
->
get
(
'Config'
)
->
get
(
'max_daily_boost_views'
);
return
$acc
+
$boost
->
getImpressions
()
>
$maxDaily
;
//still allow 10k
}
...
...
This diff is collapsed.
Click to expand it.
settings.example.php
View file @
2f37b154
...
...
@@ -275,6 +275,9 @@ $CONFIG->set('boost', [
],
]);
/* Maximum view per day */
$config
->
set
(
'max_daily_boost_views'
,
10000
);
$CONFIG
->
set
(
'encryptionKeys'
,
[
'email'
=>
[
'private'
=>
'{{email-private-key}}'
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment