File tree Expand file tree Collapse file tree
java/run/ikaros/plugin/pan115 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。
44
5+ # 1.0.14
6+
7+ - 优化刷新令牌逻辑
8+
59# 1.0.13
610
711- 修复异常空的逻辑
Original file line number Diff line number Diff line change 11group =run.ikaros.plugin
22description =A pan115 plugin for ikaros.
3- version =1.0.13
3+ version =1.0.14
Original file line number Diff line number Diff line change @@ -61,13 +61,11 @@ private Mono<AttachmentDriver> checkoutToken(Long driverId) {
6161 Assert .isTrue (driverId >= 0 , "driverId is negative" );
6262 log .debug ("Do checkoutToken for driverId={}" , driverId );
6363 return driverOperate .findById (driverId )
64- .filter (driver -> driver .getExpireTime () == null
65- || driver .getExpireTime ().isBefore (LocalDateTime .now ()))
66- .flatMap (this ::applyPan115Token )
67- .flatMap (driver -> {
68- pan115Repository .refreshHttpHeaders (driver .getAccessToken ());
69- return driverOperate .save (driver );
70- }).switchIfEmpty (driverOperate .findById (driverId ));
64+ .filter (driver -> driver .getExpireTime () != null
65+ && driver .getExpireTime ().isAfter (LocalDateTime .now ()))
66+ .switchIfEmpty (driverOperate .findById (driverId )
67+ .flatMap (this ::applyPan115Token )
68+ .flatMap (driverOperate ::save ));
7169 }
7270
7371 @ Override
Original file line number Diff line number Diff line change 1616@ Slf4j
1717@ Component
1818public class Pan115Plugin extends BasePlugin {
19- private final Pan115AttachmentDriverFetcher driverFetcher ;
20-
21- public Pan115Plugin (PluginWrapper wrapper , Pan115AttachmentDriverFetcher driverFetcher ) {
19+ public Pan115Plugin (PluginWrapper wrapper ) {
2220 super (wrapper );
23- this .driverFetcher = driverFetcher ;
2421 }
2522
2623 @ Override
2724 public void start () {
2825 log .info ("plugin [Pan115Plugin] start success" );
2926 }
3027
31- public Disposable startRefreshTokenTask () {
32- return Flux .interval (Duration .ofMinutes (30 ))
33- .flatMap (tick -> refreshTokenTask ())
34- .subscribeOn (Schedulers .newSingle ("RefreshTokenTask" , true ))
35- .subscribe ();
36- }
37-
38- private Mono <Void > refreshTokenTask () {
39- return driverFetcher .checkoutAllDriverToken ();
40- }
41-
4228 @ Override
4329 public void stop () {
4430 log .info ("plugin [Pan115Plugin] stop success" );
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ name: PluginPan115
44# plugin entry class that extends BasePlugin
55clazz : run.ikaros.plugin.pan115.Pan115Plugin
66# plugin 'version' is a valid semantic version string (see semver.org).
7- version : 1.0.13
7+ version : 1.0.14
88requires : " >=1.0.6"
99author :
1010 name : Ikaros OSS Team
You can’t perform that action at this time.
0 commit comments