Created
January 29, 2016 16:47
-
-
Save mindspank/394d345d83a19f224bf8 to your computer and use it in GitHub Desktop.
reload apps in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Using Bluebird to help us with async flow control | |
| const Promise = require('bluebird'); | |
| // Qsocks is used to help with Engine API comminication | |
| const qsocks = require('qsocks'); | |
| // Connecting to Qlik Sense Desktop | |
| qsocks.Connect().then(function(global) { | |
| // We store the global connection | |
| const globalConnection = global; | |
| globalConnection.getDocList().then(function(list) { | |
| return list.map(function(item) { return item.qDocId; }) | |
| }) | |
| .then(function(list) { | |
| return Promise.map(list, function(id) { | |
| return qsocks.Connect({appname: id}).then(function(global) { | |
| return global.openDoc(id).then(function(app) { | |
| return app.doReload().then(app.doSave); | |
| }) | |
| },[]) | |
| }, {concurrency: 1}) | |
| }) | |
| .then(function(arrayOfSuccessResults) { | |
| console.log(arrayOfSuccessResults); | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment