You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.6 KiB
49 lines
1.6 KiB
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); |
|
} |
|
}); |
|
} |
|
}
|
|
|