Skip to content

Commit 76f4b81

Browse files
fix: add delay before calling script (#955)
Signed-off-by: Jeffrey Tang <[email protected]>
1 parent 2230bd1 commit 76f4b81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core/platform_installer.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import chalk from 'chalk';
2828

2929
import {type SoloLogger} from './logging.js';
3030
import type {NodeAlias, NodeAliases, PodName} from '../types/aliases.js';
31+
import {Duration} from './time/duration.js';
32+
import {sleep} from './helpers.js';
3133

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

105+
// wait a few seconds before calling the script to avoid "No such file" error
106+
await sleep(Duration.ofSeconds(2));
107+
103108
const extractScript = path.join(constants.HEDERA_USER_HOME_DIR, scriptName); // inside the container
104109
await this.k8.execContainer(podName, constants.ROOT_CONTAINER, `chmod +x ${extractScript}`);
105110
await this.k8.execContainer(podName, constants.ROOT_CONTAINER, [extractScript, tag]);

0 commit comments

Comments
 (0)