Skip to content

Commit

Permalink
feat: Add optional delay after each QVF file upload to Sense
Browse files Browse the repository at this point in the history
Implements #198
  • Loading branch information
Göran Sander committed Mar 17, 2023
1 parent d27de61 commit 6395408
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/ctrl-q.js
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ const program = new Command();
'import at most x number of tasks from the source file. Defaults to 0 = no limit',
0
)
.requiredOption(
'--sleep-app-upload <milliseconds>',
'Wait this long before continuing after each app has been uploaded to Sense. Defaults to 1000 = 1 second',
1000
)

.option('--import-app', 'import Sense app QVFs from specified directory')
.option('--import-app-sheet-name <name>', 'name of Excel sheet where app definitions are found')
Expand Down Expand Up @@ -570,6 +575,11 @@ const program = new Command();
.requiredOption('--sheet-name <name>', 'name of Excel sheet where app info is found')

.requiredOption('--limit-import-count <number>', 'import at most x number of apps. Defaults to 0 = no limit', 0)
.requiredOption(
'--sleep-app-upload <milliseconds>',
'Wait this long before continuing after each app has been uploaded to Sense. Defaults to 1000 = 1 second',
1000
)

.option('--dry-run', 'do a dry run, i.e. do not import any apps - just show what would be done');

Expand Down
3 changes: 2 additions & 1 deletion src/lib/app/class_allapps.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@ class QlikSenseApps {

// Upload QVF
const result = await myAxiosInstance.request(axiosConfig);
// await sleep(1000);
logger.verbose(`App upload done, sleeping for ${this.options.sleepAppUpload} milliseconds`);
await sleep(this.options.sleepAppUpload);

if (result.status === 201) {
logger.debug(`Import app from QVF file success, result from API:\n${JSON.stringify(result.data, null, 2)}`);
Expand Down

0 comments on commit 6395408

Please sign in to comment.