Qlik Community

Ask a Question

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
dselgo_eidex
Partner
Partner

Is it possible to check if an app is currently reloading via an API?

Hello, I manage an app that currently takes around an hour to finish reloading. The load script for this app also has a Section Access load to keep users from seeing data that they should not have access to. Now, we often make changes to the table containing the restricting information (e.g. adding a user, updating what data they have access to, etc.). For those times, we do not want to wait the entire one hour load time just to adjust one user, so we made the Section Access load only run when a partial reload is being executed. The problem is triggering that partial reload.

I've set up a connection between our .NET API and our Qlik Sense server to execute a partial reload whenever we create or update a user. I am using the .NET SDK and the DoReload(partial: true) method. This is working fine but it does cause one issue. If you reload the app while a normal reload is being executed, then it will be canceled.

For instance: Person 1 is currently reloading the app through the hub. Person 2 is adding a couple of users to our system. When Person 2 adds a user, our API will call the DoReload method, and Person 1's reload will be cancelled. This has happened in the past and is very frustrating when we are 45+ min in to the full reload.

I'm trying to find a way to first check to see if the app is reloading before I call the DoReload method. I know that there is the GetProgress method, but that only works if you know the requestId (which our API would have no knowledge of). I also know that I could create a reload task, but those don't offer the ability to execute a partial reload. Can anyone offer any guidance or ideas on how I can accomplish this?

Labels (4)
1 Solution

Accepted Solutions
stevedark
MVP & Luminary
MVP & Luminary

Hi @dselgo_eidex ,

This may be possible, but would it not be simpler just to write to a file with a STORE statement at the start of the script and again at the end of the script. This file can then be read at any point to see what state the load is in. That could be with another Qlik load script, or any other tool that can read a text file.

Steve

View solution in original post

2 Replies
stevedark
MVP & Luminary
MVP & Luminary

Hi @dselgo_eidex ,

This may be possible, but would it not be simpler just to write to a file with a STORE statement at the start of the script and again at the end of the script. This file can then be read at any point to see what state the load is in. That could be with another Qlik load script, or any other tool that can read a text file.

Steve

View solution in original post

dselgo_eidex
Partner
Partner
Author

I don't know if I would consider that simpler than having an API function to check the reload status, but that idea would certainly work. I had considered writing to a variable in the script and then reading that variable, but the variable could only be read after the app was saved. Your idea is similar except it gets around that issue.

However, I did discover that the .NET SDK will actually throw an Qlik.Engine.MethodInvocationException when you try to invoke 

IApp app = location.App(...)

if the app in question has a reload in progress so long as the user that is reloading the app through the hub and the user that is trying to reload through the .NET SDK are the same user. After finding this out I have established a rule that we will always reload our app using the service account that our API uses.

If this ever becomes a solution we don't want to keep doing, I will most likely try out your idea of writing to a file.