Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
339
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
29
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TransFem.org
Sharkey
Commits
17b6c1b3
Commit
17b6c1b3
authored
6 months ago
by
dakkar
Browse files
Options
Downloads
Patches
Plain Diff
tell the linter to shut up, this time
parent
1b5bedc1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!620
Bump version
,
!603
thunk the min/max promises
Pipeline
#1042
passed with stage
in 21 minutes and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/backend/src/server/api/RateLimiterService.ts
+10
-2
10 additions, 2 deletions
packages/backend/src/server/api/RateLimiterService.ts
with
10 additions
and
2 deletions
packages/backend/src/server/api/RateLimiterService.ts
+
10
−
2
View file @
17b6c1b3
...
...
@@ -37,7 +37,12 @@ export class RateLimiterService {
return
Promise
.
resolve
();
}
// those lines with the "wrong" brace style / indentation are
// done that way so that the *other* lines stay identical to
// Misskey, simplifying merges
// Short-term limit
// eslint-disable-next-line brace-style
const
minP
=
()
=>
{
return
new
Promise
<
void
>
((
ok
,
reject
)
=>
{
const
minIntervalLimiter
=
new
Limiter
({
id
:
`
${
actor
}
:
${
limitation
.
key
}
:min`
,
...
...
@@ -63,9 +68,11 @@ export class RateLimiterService {
}
}
});
})
};
// eslint-disable-next-line brace-style
});
};
// Long term limit
// eslint-disable-next-line brace-style
const
maxP
=
()
=>
{
return
new
Promise
<
void
>
((
ok
,
reject
)
=>
{
const
limiter
=
new
Limiter
({
id
:
`
${
actor
}
:
${
limitation
.
key
}
`
,
...
...
@@ -87,7 +94,8 @@ export class RateLimiterService {
return
ok
();
}
});
})
};
// eslint-disable-next-line brace-style
});
};
const
hasShortTermLimit
=
typeof
limitation
.
minInterval
===
'
number
'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment