Skip to content

Commit

Permalink
fix: add delay before calling script (#955)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Tang <[email protected]>
  • Loading branch information
JeffreyDallas authored Dec 10, 2024
1 parent 2230bd1 commit 76f4b81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/platform_installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import chalk from 'chalk';

import {type SoloLogger} from './logging.js';
import type {NodeAlias, NodeAliases, PodName} from '../types/aliases.js';
import {Duration} from './time/duration.js';
import {sleep} from './helpers.js';

/** PlatformInstaller install platform code in the root-container of a network pod */
export class PlatformInstaller {
Expand Down Expand Up @@ -100,6 +102,9 @@ export class PlatformInstaller {
const sourcePath = path.join(constants.RESOURCES_DIR, scriptName); // script source path
await this.copyFiles(podName, [sourcePath], constants.HEDERA_USER_HOME_DIR);

// wait a few seconds before calling the script to avoid "No such file" error
await sleep(Duration.ofSeconds(2));

const extractScript = path.join(constants.HEDERA_USER_HOME_DIR, scriptName); // inside the container
await this.k8.execContainer(podName, constants.ROOT_CONTAINER, `chmod +x ${extractScript}`);
await this.k8.execContainer(podName, constants.ROOT_CONTAINER, [extractScript, tag]);
Expand Down

0 comments on commit 76f4b81

Please sign in to comment.