Skip to content

Commit

Permalink
chore: add prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed May 25, 2023
1 parent 0d29af9 commit 43d8ff7
Show file tree
Hide file tree
Showing 9 changed files with 3,114 additions and 221 deletions.
10 changes: 5 additions & 5 deletions .docsifytopdfrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
contents: ["summary.md"],
pathToPublic: "pdf/advanced-java.pdf",
pdfOptions: "<options for puppeteer.pdf()>",
removeTemp: true,
emulateMedia: "screen",
contents: ['summary.md'],
pathToPublic: 'pdf/advanced-java.pdf',
pdfOptions: '<options for puppeteer.pdf()>',
removeTemp: true,
emulateMedia: 'screen',
};
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ yarn-debug.log*
yarn-error.log*

dist
package-lock.json
lib

node_modules
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
.github/
node_modules/
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid"
}
}
88 changes: 44 additions & 44 deletions docs/high-concurrency/how-to-limit-current.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,25 +288,25 @@ public class TokenBucket {

```yaml
spring:
cloud:
gateway:
routes:
- id: requestratelimiter_route
uri: lb://pigx-upms
order: 10000
predicates:
- Path=/admin/**
filters:
- name: RequestRateLimiter
args:
redis-rate-limiter.replenishRate: 1 # 令牌桶的容积
redis-rate-limiter.burstCapacity: 3 # 流速 每秒
key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean

- StripPrefix=1
cloud:
gateway:
routes:
- id: requestratelimiter_route

uri: lb://pigx-upms
order: 10000
predicates:
- Path=/admin/**

filters:
- name: RequestRateLimiter

args:
redis-rate-limiter.replenishRate: 1 # 令牌桶的容积
redis-rate-limiter.burstCapacity: 3 # 流速 每秒
key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean

- StripPrefix=1
```

```java
Expand All @@ -329,37 +329,37 @@ KeyResolver remoteAddrKeyResolver() {

```yaml
spring:
cloud:
nacos:
discovery:
server-addr: localhost:8848
sentinel:
transport:
dashboard: localhost:8080
port: 8720
datasource:
ds:
nacos:
server-addr: localhost:8848
dataId: spring-cloud-sentinel-nacos
groupId: DEFAULT_GROUP
rule-type: flow
namespace: xxxxxxxx
cloud:
nacos:
discovery:
server-addr: localhost:8848
sentinel:
transport:
dashboard: localhost:8080
port: 8720
datasource:
ds:
nacos:
server-addr: localhost:8848
dataId: spring-cloud-sentinel-nacos
groupId: DEFAULT_GROUP
rule-type: flow
namespace: xxxxxxxx
```

- 配置内容在 nacos 上进行编辑

```json
[
{
"resource": "/hello",
"limitApp": "default",
"grade": 1,
"count": 1,
"strategy": 0,
"controlBehavior": 0,
"clusterMode": false
}
{
"resource": "/hello",
"limitApp": "default",
"grade": 1,
"count": 1,
"strategy": 0,
"controlBehavior": 0,
"clusterMode": false
}
]
```

Expand Down

0 comments on commit 43d8ff7

Please sign in to comment.