Commit 6d30345631da14ef9906b4b5434e9d95c01f0a00

Authored by shiyang
1 parent 37a355cd1b
Exists in master

调整token获取时间

Showing 2 changed files with 2 additions and 2 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/AccessTokenServlet.java View file @ 6d30345
... ... @@ -15,7 +15,7 @@
15 15 * 启动后开启线程每1小时59获取一次token,保证长期有效。(微信公众号规定2小时token失效,每天只能获取2000次。)
16 16 * @throws ServletException
17 17 */
18   - @PostConstruct
  18 + @PostConstruct//部署后启动方法
19 19 public void init() throws ServletException {
20 20 TokenThread.appId = appId;
21 21 TokenThread.appSecret = appSecret;
talkonlineweb/src/main/java/com/lyms/talkonlineweb/task/TokenThread.java View file @ 6d30345
... ... @@ -16,7 +16,7 @@
16 16 accessToken = this.getToken();
17 17 if(null!=accessToken){
18 18 System.out.println(accessToken);
19   - Thread.sleep(7000 * 1); //获取到access_token 休眠7000秒
  19 + Thread.sleep(7000 * 1000); //获取到access_token 休眠7000秒
20 20  
21 21 }else{
22 22 Thread.sleep(1000*3); //获取的access_token为空 休眠3秒