버그 처리
This commit is contained in:
@@ -96,34 +96,20 @@ namespace UVC.Data.Http
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
// 매핑된 데이터를 DataRepository에 저장하거나 업데이트합니다.
|
||||
var repoObject = mappedObject;
|
||||
if (mappedObject != null)
|
||||
{
|
||||
// DataRepository는 모든 데이터를 중앙에서 관리하는 저장소입니다.
|
||||
repoObject = DataRepository.Instance.AddOrUpdateData(key, mappedObject, info.UpdatedDataOnly);
|
||||
var repoObject = DataRepository.Instance.AddOrUpdateData(key, mappedObject, info.UpdatedDataOnly);
|
||||
// 만약 반환된 객체가 원본과 같다면, 핸들러에 전달하기 위해 복제본을 만듭니다.
|
||||
if (repoObject == mappedObject) repoObject = mappedObject.Clone(fromPool: false);
|
||||
}
|
||||
// 'UpdatedDataOnly' 옵션이 켜져 있고, 실제로 데이터가 업데이트되었을 때만 핸들러를 호출합니다.
|
||||
if (info.UpdatedDataOnly)
|
||||
{
|
||||
if (repoObject != null && repoObject.UpdatedCount > 0)
|
||||
{
|
||||
if (info.SuccessHandler != null)
|
||||
{
|
||||
var handlerData = repoObject;
|
||||
UniTask.Post(() => info.SuccessHandler.Invoke(handlerData));
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 최종적으로 처리된 데이터가 있는 경우 성공 핸들러를 호출합니다.
|
||||
if (repoObject != null)
|
||||
{
|
||||
if (info.SuccessHandler != null)
|
||||
|
||||
bool shouldInvoke = !info.UpdatedDataOnly || (repoObject != null && repoObject.UpdatedCount > 0);
|
||||
// 'UpdatedDataOnly' 옵션이 켜져 있고, 실제로 데이터가 업데이트되었을 때만 핸들러를 호출합니다.
|
||||
if (shouldInvoke && info.SuccessHandler != null)
|
||||
{
|
||||
var handlerData = repoObject;
|
||||
UniTask.Post(() => info.SuccessHandler.Invoke(handlerData));
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 처리된 데이터가 없는 경우 실패 핸들러를 호출합니다.
|
||||
|
||||
Reference in New Issue
Block a user