Skip to content

Commit c54c61d

Browse files
refactor: sleep timer (#400)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/cc99acfa-05b8-434b-9500-2f6faf2eaa02/targets - [ ] To automatically regenerate this PR, check this box.
1 parent 7b71e77 commit c54c61d

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

packages/google-cloud-dataproc/README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ function main(projectId, region, clusterName, jobFilePath) {
6666
const dataproc = require('@google-cloud/dataproc');
6767
const {Storage} = require('@google-cloud/storage');
6868

69-
const sleep = require('sleep');
70-
7169
// Create a cluster client with the endpoint set to the desired cluster region
7270
const clusterClient = new dataproc.v1.ClusterControllerClient({
7371
apiEndpoint: `${region}-dataproc.googleapis.com`,
@@ -149,7 +147,7 @@ function main(projectId, region, clusterName, jobFilePath) {
149147
);
150148
break;
151149
}
152-
await sleep.sleep(1);
150+
await sleep(1);
153151
[jobResp] = await jobClient.getJob(jobReq);
154152
}
155153

@@ -187,6 +185,11 @@ function main(projectId, region, clusterName, jobFilePath) {
187185
quickstart();
188186
}
189187

188+
// Helper function to sleep for the given number of seconds
189+
function sleep(seconds) {
190+
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
191+
}
192+
190193
const args = process.argv.slice(2);
191194

192195
if (args.length !== 4) {

packages/google-cloud-dataproc/synth.metadata

+10-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,16 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "[email protected]:googleapis/nodejs-dataproc.git",
7-
"sha": "665679481d8175126a24bfc3e3cc12b65df676a4"
6+
"remote": "https://github.com/googleapis/nodejs-dataproc.git",
7+
"sha": "9f96dc932e54f76ea997a9a9de9d23948e6b236e"
8+
}
9+
},
10+
{
11+
"git": {
12+
"name": "googleapis",
13+
"remote": "https://github.com/googleapis/googleapis.git",
14+
"sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be",
15+
"internalRef": "320300472"
816
}
917
},
1018
{

0 commit comments

Comments
 (0)