Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
e921b4c7
Commit
e921b4c7
authored
Mar 02, 2020
by
杨锐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get token demotion
parent
9d1ecf96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
pom.xml
brave-spring-boot-starter/pom.xml
+5
-0
TokenJob.java
.../src/main/java/cn/quantgroup/tech/brave/job/TokenJob.java
+8
-0
No files found.
brave-spring-boot-starter/pom.xml
View file @
e921b4c7
...
...
@@ -116,6 +116,11 @@
<version>
${brave.version}
</version>
</dependency>
<dependency>
<groupId>
com.alibaba
</groupId>
<artifactId>
transmittable-thread-local
</artifactId>
<version>
2.11.4
</version>
</dependency>
</dependencies>
...
...
brave-spring-boot-starter/src/main/java/cn/quantgroup/tech/brave/job/TokenJob.java
View file @
e921b4c7
...
...
@@ -63,6 +63,14 @@ public class TokenJob {
}
}
@Scheduled
(
cron
=
"0 */2 * * * ?"
)
public
void
getTokenDemotion
()
{
if
(
StringUtils
.
isBlank
(
TokenHandler
.
getToken
()))
{
getToken
();
}
}
private
String
base64ForCredential
()
{
String
credential
=
clientId
+
":"
+
secret
;
return
Base64
.
getEncoder
().
encodeToString
(
credential
.
getBytes
());
...
...
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