This repository has been archived by the owner on Jul 21, 2024. It is now read-only.
forked from jnightlee/webdav-teambition
-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ 增加定时任务,每30-60分钟请求一下接口,确保 Refresh Token 不过期
- Loading branch information
Showing
5 changed files
with
104 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/java/com/github/zxbu/webdavteambition/store/StartupService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.github.zxbu.webdavteambition.store; | ||
|
||
import com.github.zxbu.webdavteambition.config.AliYunDriverCronTask; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.servlet.GenericServlet; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
|
||
public class StartupService extends GenericServlet { | ||
|
||
private AliYunDriverCronTask mAliYunDriverCronTask; | ||
|
||
@Override | ||
public void init() throws ServletException { | ||
super.init(); | ||
AliYunDriverCronTask task = mAliYunDriverCronTask; | ||
if (task != null) { | ||
task.stop(); | ||
} | ||
task = new AliYunDriverCronTask(AliYunDriverClientService.getInstance()); | ||
mAliYunDriverCronTask = task; | ||
task.start(); | ||
} | ||
|
||
@Override | ||
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { | ||
|
||
} | ||
|
||
@Override | ||
public void destroy() { | ||
super.destroy(); | ||
AliYunDriverCronTask task = mAliYunDriverCronTask; | ||
if (task != null) { | ||
task.stop(); | ||
mAliYunDriverCronTask = null; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters