Skip to content

Commit

Permalink
fix: deactivateonidle
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Oct 28, 2024
1 parent df00338 commit ce32d47
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
13 changes: 9 additions & 4 deletions src/PlaygroundGrains/BuildGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ public class BuildGrain : ProcessGrain<BuildRequestDto, BuildResponseDto>, IBuil
}
finally
{
if (Directory.Exists(_tempFolder))
{
Directory.Delete(_tempFolder, true);
}
DeactivateOnIdle();
}

return new BuildResponseDto
Expand All @@ -109,5 +106,13 @@ public class BuildGrain : ProcessGrain<BuildRequestDto, BuildResponseDto>, IBuil
Message = "Build failed"
};
}

OnDeactivateAsync()
{
if (Directory.Exists(_tempFolder))
{
Directory.Delete(_tempFolder, true);
}
}
}

13 changes: 9 additions & 4 deletions src/PlaygroundGrains/TemplateGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ public class TemplateGrain : ProcessGrain<TemplateRequestDto, TemplateResponseDt
}
finally
{
if (Directory.Exists(_tempFolder))
{
Directory.Delete(_tempFolder, true);
}
DeactivateOnIdle();
}

return new TemplateResponseDto
Expand All @@ -76,5 +73,13 @@ public class TemplateGrain : ProcessGrain<TemplateRequestDto, TemplateResponseDt
Message = "Template failed"
};
}

OnDeactivateAsync()
{
if (Directory.Exists(_tempFolder))
{
Directory.Delete(_tempFolder, true);
}
}
}

13 changes: 9 additions & 4 deletions src/PlaygroundGrains/TestGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ public class TestGrain : ProcessGrain<TestRequestDto, TestResponseDto>, ITestGra
}
finally
{
if (Directory.Exists(_tempFolder))
{
Directory.Delete(_tempFolder, true);
}
DeactivateOnIdle();
}

return new TestResponseDto
Expand All @@ -82,5 +79,13 @@ public class TestGrain : ProcessGrain<TestRequestDto, TestResponseDto>, ITestGra
Message = "Test failed"
};
}

OnDeactivateAsync()
{
if (Directory.Exists(_tempFolder))
{
Directory.Delete(_tempFolder, true);
}
}
}

0 comments on commit ce32d47

Please sign in to comment.