Search in sources :

Example 1 with ResSynManager

use of com.qlangtech.tis.runtime.pojo.ResSynManager in project tis by qlangtech.

the class SaveFileContentAction method doSyncDailyConfig.

/**
 * 将日常的文件同步到线上<br>
 * 这段逻辑原先应该是在线上执行的,现在要放在日常上执行,日常连线上肯定是可以执行的
 *
 * @param context
 */
@Func(PermissionConstant.CONFIG_SYNCHRONIZE_FROM_DAILY)
public void doSyncDailyConfig(Context context) throws Exception {
    AppDomainInfo app = this.getAppDomain();
    Assert.assertEquals(this.getInt("appid"), app.getAppid());
    // 配置文件同步控制器
    final ResSynManager synManager = ResSynManager.createSynManagerOnlineFromDaily(app.getAppName(), this);
    if (!synManager.shallSynchronize()) {
        this.addErrorMessage(context, "DAILY环境配置文件已经同步到线上,不需要再同步了");
        return;
    }
    // final Snapshot snapshot =
    if (synManager.getSynchronizedOnlineSnapshot(context, this)) {
        this.addActionMessage(context, "已经将日常的配置成功发布到线上生产环境");
    }
// 创建新SNAPSHOT
// this.addActionMessage(
// context,
// "同步文件成功,最新snapshot:"
// + createNewSnapshot(snapshot, "synchronize from daily",
// this, new Long(this.getUserId()),
// this.getLoginUserName()));
}
Also used : ResSynManager(com.qlangtech.tis.runtime.pojo.ResSynManager) Func(com.qlangtech.tis.manage.spring.aop.Func)

Aggregations

Func (com.qlangtech.tis.manage.spring.aop.Func)1 ResSynManager (com.qlangtech.tis.runtime.pojo.ResSynManager)1