public class RemoteAgentWorkspaceManagerImpl extends Object implements AgentWorkspacesManager
Constructor and Description |
---|
RemoteAgentWorkspaceManagerImpl(BuildDirectoryManager buildDirectoryManager,
TaskContainerExistenceService taskContainerExistenceService,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
void |
onEnvironmentsDeleted(MultipleEnvironmentsDeletedEvent event) |
void |
onJobDeleted(BuildDeletedEvent event) |
void |
onJobsDeleted(MultipleJobsDeletedEvent event) |
void |
registerWorkspace(Key key)
Register workspace as being in use.
|
void |
scanAndRemoveUnusedWorkspaces()
Search for workspaces related to deleted jobs & environments.
|
void |
unregisterWorkspace(Key key)
Mark workspace as unused and to be deleted in the next
AgentWorkspacesManager.scanAndRemoveUnusedWorkspaces() . |
@Inject public RemoteAgentWorkspaceManagerImpl(@NotNull BuildDirectoryManager buildDirectoryManager, @NotNull TaskContainerExistenceService taskContainerExistenceService, @NotNull com.atlassian.event.api.EventPublisher eventPublisher)
public void scanAndRemoveUnusedWorkspaces()
AgentWorkspacesManager
AgentWorkspacesManager.registerWorkspace(Key)
, contact the server and check if the corresponding object still exists.
After that, remove workspaces that are no longer used.scanAndRemoveUnusedWorkspaces
in interface AgentWorkspacesManager
public void registerWorkspace(@NotNull Key key)
AgentWorkspacesManager
AgentWorkspacesManager.scanAndRemoveUnusedWorkspaces()
for the next 24h.registerWorkspace
in interface AgentWorkspacesManager
public void unregisterWorkspace(@NotNull Key key)
AgentWorkspacesManager
AgentWorkspacesManager.scanAndRemoveUnusedWorkspaces()
.unregisterWorkspace
in interface AgentWorkspacesManager
@EventListener public void onJobsDeleted(@NotNull MultipleJobsDeletedEvent event)
@EventListener public void onJobDeleted(@NotNull BuildDeletedEvent event)
@EventListener public void onEnvironmentsDeleted(@NotNull MultipleEnvironmentsDeletedEvent event)
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.