fix: 脚本用自己内容的hash生成路径,避免与config文件冲突导致file exists
This commit is contained in:
@@ -83,10 +83,11 @@ public class ConfigServiceImpl implements ConfigService {
|
||||
}
|
||||
}
|
||||
|
||||
// 存储 Groovy 脚本
|
||||
// 存储 Groovy 脚本(用脚本自己的 hash,不和 config 共用)
|
||||
String scriptPath = null;
|
||||
if (hasScript) {
|
||||
scriptPath = String.format("configs/%s/pending/%s.groovy", siteId, idPrefix);
|
||||
String scriptHash = HmacUtil.sha256(groovyScript);
|
||||
scriptPath = String.format("configs/%s/pending/%s.groovy", siteId, scriptHash.substring(0, 8));
|
||||
storageService.store(scriptPath, groovyScript);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user