improve locking naming

pull/524/head
Frostebite 2023-03-20 02:26:53 +00:00
parent 1c1eee7d46
commit ab12cda1c3
5 changed files with 5 additions and 9 deletions

View File

@ -48,7 +48,7 @@ jobs:
- 'cloud-runner-environment' - 'cloud-runner-environment'
- 'cloud-runner-hooks' - 'cloud-runner-hooks'
- 'cloud-runner-local-persistence' - 'cloud-runner-local-persistence'
- 'cloud-runner-locking' - 'cloud-runner-locking-core'
- 'cloud-runner-locking-get-locked' - 'cloud-runner-locking-get-locked'
providerStrategy: providerStrategy:
# - aws # - aws
@ -106,7 +106,7 @@ jobs:
#- 'cloud-runner-hooks' #- 'cloud-runner-hooks'
- 'cloud-runner-s3-steps' - 'cloud-runner-s3-steps'
#- 'cloud-runner-local-persistence' #- 'cloud-runner-local-persistence'
# - 'cloud-runner-locking' #- 'cloud-runner-locking-core'
#- 'cloud-runner-locking-get-locked' #- 'cloud-runner-locking-get-locked'
providerStrategy: providerStrategy:
- aws - aws

2
dist/index.js vendored
View File

@ -5333,7 +5333,6 @@ class SharedWorkspaceLocking {
const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces(buildParametersContext); const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces(buildParametersContext);
cloud_runner_logger_1.default.log(`run agent ${runId} is trying to access a workspace, free: ${JSON.stringify(workspaces)}`); cloud_runner_logger_1.default.log(`run agent ${runId} is trying to access a workspace, free: ${JSON.stringify(workspaces)}`);
for (const element of workspaces) { for (const element of workspaces) {
await new Promise((promise) => setTimeout(promise, 1000));
const lockResult = await SharedWorkspaceLocking.LockWorkspace(element, runId, buildParametersContext); const lockResult = await SharedWorkspaceLocking.LockWorkspace(element, runId, buildParametersContext);
cloud_runner_logger_1.default.log(`run agent: ${runId} try lock workspace: ${element} locking attempt result: ${lockResult}`); cloud_runner_logger_1.default.log(`run agent: ${runId} try lock workspace: ${element} locking attempt result: ${lockResult}`);
if (lockResult) { if (lockResult) {
@ -5372,7 +5371,6 @@ class SharedWorkspaceLocking {
const result = []; const result = [];
const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext); const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext);
for (const element of workspaces) { for (const element of workspaces) {
await new Promise((promise) => setTimeout(promise, 1500));
const isLocked = await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParametersContext); const isLocked = await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParametersContext);
const isBelowMax = await SharedWorkspaceLocking.IsWorkspaceBelowMax(element, buildParametersContext); const isBelowMax = await SharedWorkspaceLocking.IsWorkspaceBelowMax(element, buildParametersContext);
cloud_runner_logger_1.default.log(`workspace ${element} locked:${isLocked} below max:${isBelowMax}`); cloud_runner_logger_1.default.log(`workspace ${element} locked:${isLocked} below max:${isBelowMax}`);

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -71,7 +71,6 @@ export class SharedWorkspaceLocking {
const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces(buildParametersContext); const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces(buildParametersContext);
CloudRunnerLogger.log(`run agent ${runId} is trying to access a workspace, free: ${JSON.stringify(workspaces)}`); CloudRunnerLogger.log(`run agent ${runId} is trying to access a workspace, free: ${JSON.stringify(workspaces)}`);
for (const element of workspaces) { for (const element of workspaces) {
await new Promise((promise) => setTimeout(promise, 1000));
const lockResult = await SharedWorkspaceLocking.LockWorkspace(element, runId, buildParametersContext); const lockResult = await SharedWorkspaceLocking.LockWorkspace(element, runId, buildParametersContext);
CloudRunnerLogger.log( CloudRunnerLogger.log(
`run agent: ${runId} try lock workspace: ${element} locking attempt result: ${lockResult}`, `run agent: ${runId} try lock workspace: ${element} locking attempt result: ${lockResult}`,
@ -131,7 +130,6 @@ export class SharedWorkspaceLocking {
const result: string[] = []; const result: string[] = [];
const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext); const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext);
for (const element of workspaces) { for (const element of workspaces) {
await new Promise((promise) => setTimeout(promise, 1500));
const isLocked = await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParametersContext); const isLocked = await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParametersContext);
const isBelowMax = await SharedWorkspaceLocking.IsWorkspaceBelowMax(element, buildParametersContext); const isBelowMax = await SharedWorkspaceLocking.IsWorkspaceBelowMax(element, buildParametersContext);
CloudRunnerLogger.log(`workspace ${element} locked:${isLocked} below max:${isBelowMax}`); CloudRunnerLogger.log(`workspace ${element} locked:${isLocked} below max:${isBelowMax}`);

View File

@ -16,7 +16,7 @@ async function CreateParameters(overrides: any) {
return await BuildParameters.create(); return await BuildParameters.create();
} }
describe('Cloud Runner Locking', () => { describe('Cloud Runner Locking Core', () => {
setups(); setups();
it('Responds', () => {}); it('Responds', () => {});
if (CloudRunnerOptions.cloudRunnerDebug) { if (CloudRunnerOptions.cloudRunnerDebug) {