Picture of iqbal
Registered 5 years 81 days
iqbal Monday, 22 May 2023, 10:38 AM in response to Marc Schodermayr (innovaphone)
Re: App crashes always writing config value to database
Hi Marc
I will try with debug build und let you know about results and the writeLastTokenRefreshAtTask is a simple ITask like:

std::unique_ptr<ITask> writeLastTokenRefreshAtTask; 

in instance class Header:

class WhoisOn : public AppInstance , public AppUpdates , public UDatabase , public UWebserverPlugin , public JsonApiContext , public ConfigContext { ConfigString lastTokenRefreshAt; } 

in instance class CPP:

WhoisOn::WhoisOn( IIoMux * const iomux , WhoisOnService * service , AppInstanceArgs * args ) : AppInstance(service, args) , AppUpdates(iomux) , ConfigContext(nullptr, this) , stopping() , pbxSession() , accessToken(this, "accessToken", "") , refreshToken(this, "refreshToken", "") , lastTokenRefreshAt(this, "lastTokenRefreshAt", "") } 

that is started here as described in initial post:

else if (task == writeExpiresInTask.get())
{ if (isTeamsAccessTokenRefreshFailed == false)
{ writeLastTokenRefreshAtTask.reset( instance->WriteItemValue( &instance->lastTokenRefreshAt , getTimeStamp() , false ) );
writeLastTokenRefreshAtTask->Start(this); } else { TaskFailed(task);
}
}
else if (task == writeLastTokenRefreshAtTask.get())
{ instance->AccessTokenRefreshComplete(true);
}
← You can define your color theme preference here