Skip to content

Commit

Permalink
3.6.18191.1802
Browse files Browse the repository at this point in the history
데이터 베이스에 사용자가 있는 상황에서 데이터 베이스를 비활성화 시킬때
Expired 이벤트 해제가 안되는 부분 수정

Authentication.Expired 이벤트 제거 부분 버그 수정

데이터 베이스가 삭제되었을때 관련 도메인 삭제 이벤트를 발생하지 않고
도메인의 카테고리와 실제 디스크 경로만 지우는것으로 변경
(클라이언트에서도 동일한 작업이 진행되는데 이부분 때문에 쓸때없이
클라이언트에 wcf 이벤트가 전달되서 오류가 발생함)

DomainContext의 Clear 함수 삭제(Dispose에서 할일임.)
  • Loading branch information
s2quake committed Jul 10, 2018
1 parent 0c4e137 commit d73a118
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 37 deletions.
2 changes: 1 addition & 1 deletion client/Ntreev.Crema.Services/Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public event EventHandler Expired
lock (lockobj)
{
if (this.parent != null)
this.expired -= value;
this.parent.expired -= value;
else
this.expired -= value;
}
Expand Down
7 changes: 0 additions & 7 deletions client/Ntreev.Crema.Services/Domains/DomainContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,20 +390,13 @@ private void DataBases_ItemDeleted(object sender, ItemsDeletedEventArgs<IDataBas

private void DeleteDomains(IDataBase dataBase)
{
var domainList = new List<Domain>();
var domainPathList = new List<string>();
foreach (var item in this.Domains.ToArray<Domain>())
{
if (item.DataBaseID == dataBase.ID)
{
var path = item.Path;
item.Dispose();
domainList.Add(item);
domainPathList.Add(path);
}
}

//this.Domains.InvokeDomainsDeletedEvent(Authentication.System, domainList.ToArray(), domainPathList.ToArray());
}

private void Service_Faulted(object sender, EventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions common/Ntreev.Crema.AssemblyInfo/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("3.6")]
[assembly: AssemblyFileVersion("3.6.18191.1642")]
[assembly: AssemblyInformationalVersion("3.6.18191.1642")]
[assembly: AssemblyFileVersion("3.6.18191.1802")]
[assembly: AssemblyInformationalVersion("3.6.18191.1802")]
2 changes: 1 addition & 1 deletion server/Ntreev.Crema.Services/Authentication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public event EventHandler Expired
lock (lockobj)
{
if (this.parent != null)
this.expired -= value;
this.parent.expired -= value;
else
this.expired -= value;
}
Expand Down
1 change: 0 additions & 1 deletion server/Ntreev.Crema.Services/CremaHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ public void Close(CloseReason reason, string message)
this.userContext.Dispatcher.Invoke(() => this.userContext.Clear());
this.UserContext.Dispose();
this.userContext = null;
this.domainContext.Clear();
this.domainContext.Dispose();
this.domainContext = null;
this.dataBases.Dispose();
Expand Down
7 changes: 1 addition & 6 deletions server/Ntreev.Crema.Services/Domains/Domain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,19 +276,14 @@ public void Write(string filename)
}
}

public void Dispose(bool disposing)
public void Dispose(DomainContext domainContext)
{
this.dispatcher.VerifyAccess();

var container = this.Container;
this.dispatcher.Dispose();
this.dispatcher = null;
this.domainLogger?.Dispose(false);
this.domainLogger = null;
this.Dispose();

if (disposing == false)
container.InvokeDomainDeletedEvent(Authentication.System, this, false);
}

public void Dispose(Authentication authentication, bool isCanceled)
Expand Down
23 changes: 5 additions & 18 deletions server/Ntreev.Crema.Services/Domains/DomainContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,12 @@ public void Restore(Authentication authentication, DataBase dataBase)
this.cremaHost.Info(Resources.Message_DomainState_Format, totalCount, succeededCount, failedCount);
}

public new void Clear()
public void Dispose()
{
foreach (var item in this.Domains.ToArray<Domain>())
{
item.Dispatcher.Invoke(() => item.Dispose(true));
item.Dispatcher.Invoke(() => item.Dispose(this));
}
base.Clear();
}

public void Dispose()
{

}

protected virtual void OnItemsCreated(ItemsCreatedEventArgs<IDomainItem> e)
Expand Down Expand Up @@ -318,6 +312,8 @@ private void DataBases_ItemDeleted(object sender, ItemsDeletedEventArgs<IDataBas
this.DeleteDomains(item);
var category = this.Root.Categories[item.Name];
var categoryPath = category.Path;
var localPath = Path.Combine(this.BasePath, $"{item.ID}");
DirectoryUtility.Delete(localPath);
category.Dispose();
categoryList.Add(category);
categoryPathList.Add(categoryPath);
Expand All @@ -328,22 +324,13 @@ private void DataBases_ItemDeleted(object sender, ItemsDeletedEventArgs<IDataBas

private void DeleteDomains(IDataBase dataBase)
{
var domainList = new List<Domain>();
var domainPathList = new List<string>();
foreach (var item in this.Domains.ToArray<Domain>())
{
if (item.DataBaseID == dataBase.ID)
{
var path = item.Path;
item.Dispatcher.Invoke(() => item.Dispose(false));
domainList.Add(item);
domainPathList.Add(path);
item.Dispatcher.Invoke(() => item.Dispose(this));
}
}

DirectoryUtility.Delete(this.BasePath, dataBase.ID.ToString());
Authentication.System.Sign();
//this.Domains.InvokeDomainsDeletedEvent(Authentication.System, domainList.ToArray(), domainPathList.ToArray());
}

#region IDomainContext
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.18191.1642
3.6.18191.1802

0 comments on commit d73a118

Please sign in to comment.