chore: ignore endless loop

oneRain 2021-03-18 18:09:41 +08:00
parent 1182eeaab4
commit 2dfc2c5d40
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,13 @@ namespace LeanCloud.Engine {
LCObject obj = LCObject.Create(className); LCObject obj = LCObject.Create(className);
obj.Merge(objectData); obj.Merge(objectData);
// 避免死循环
if (hookName.StartsWith("before")) {
obj.DisableBeforeHook();
} else {
obj.DisableAfterHook();
}
LCUser user = null; LCUser user = null;
if (dict.TryGetValue("user", out object userObj) && if (dict.TryGetValue("user", out object userObj) &&
userObj != null) { userObj != null) {

View File

@ -65,6 +65,7 @@ namespace LeanCloud.Engine {
LCApplication.Initialize(Environment.GetEnvironmentVariable("LEANCLOUD_APP_ID"), LCApplication.Initialize(Environment.GetEnvironmentVariable("LEANCLOUD_APP_ID"),
Environment.GetEnvironmentVariable("LEANCLOUD_APP_KEY"), Environment.GetEnvironmentVariable("LEANCLOUD_APP_KEY"),
Environment.GetEnvironmentVariable("LEANCLOUD_API_SERVER")); Environment.GetEnvironmentVariable("LEANCLOUD_API_SERVER"));
LCApplication.AddHeader(LCHookKeyName, Environment.GetEnvironmentVariable("LEANCLOUD_APP_HOOK_KEY"));
Assembly assembly = Assembly.GetCallingAssembly(); Assembly assembly = Assembly.GetCallingAssembly();
ClassHooks = assembly.GetTypes() ClassHooks = assembly.GetTypes()