Destiny.Lin
1 year ago
2 changed files with 51 additions and 18 deletions
@ -0,0 +1,49 @@
|
||||
package com.fr.design.mainframe.vcs; |
||||
|
||||
import com.fr.concurrent.NamedThreadFactory; |
||||
import com.fr.transaction.Configurations; |
||||
import com.fr.transaction.WorkerAdaptor; |
||||
import com.fr.workspace.WorkContext; |
||||
import com.fr.workspace.server.vcs.VcsConfig; |
||||
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanOperator; |
||||
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoCleanService; |
||||
import com.fr.workspace.server.vcs.v2.scheduler.VcsAutoRecycleSchedule; |
||||
|
||||
import java.util.concurrent.ExecutorService; |
||||
import java.util.concurrent.Executors; |
||||
|
||||
/** |
||||
* 版本管理界面配置回收事件的处理类 |
||||
* |
||||
* @author Destiny.Lin |
||||
* @since 11.0 |
||||
* Created on 2023/7/21 |
||||
*/ |
||||
public class VcsRecycleSettingHelper { |
||||
|
||||
private static ExecutorService executorService = Executors.newSingleThreadExecutor(new NamedThreadFactory("VcsRecycle")); |
||||
|
||||
|
||||
/** |
||||
* 更新任务 |
||||
* |
||||
* @param day |
||||
*/ |
||||
public static void updateJob(int day) { |
||||
executorService.execute(new Runnable() { |
||||
@Override |
||||
public void run() { |
||||
Configurations.update(new WorkerAdaptor(VcsConfig.class) { |
||||
@Override |
||||
public void run() { |
||||
VcsConfig.getInstance().setV2CleanRecycleInterval(day); |
||||
} |
||||
}); |
||||
WorkContext.getCurrent().get(VcsAutoCleanOperator.class).addOrUpdateVcsAutoCleanJob( |
||||
VcsAutoCleanService.VCS_AUTO_CLEAN_RECYCLE_JOB_NAME, |
||||
1, |
||||
VcsAutoRecycleSchedule.class); |
||||
} |
||||
}); |
||||
} |
||||
} |
Loading…
Reference in new issue