mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 12:00:37 +02:00
WIP: doesnt work (stacked in event loop)
This commit is contained in:
parent
26fbb6b281
commit
fd4440f940
@ -21,16 +21,13 @@ ColnodAPI::ColnodAPI(serversdk::RequestManager* reqMan, const bool &dryMode, con
|
||||
void ColnodAPI::downloadData(const qint64 &time)
|
||||
{
|
||||
// Have to get Login
|
||||
Timestamp timestamp;
|
||||
timestamp.setTimestamp(time);
|
||||
auto login = requestLogin();
|
||||
connect(login.get(), &serversdk::Request::finished, this, [&](){
|
||||
connect(login.get(), &serversdk::Request::finished, this, [=](){
|
||||
// Get login token
|
||||
if (!checkRequest(login)) {
|
||||
emit downloadDataFinished(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
AuthToken token;
|
||||
token.fromJson(login->responseData());
|
||||
authToken = token.id();
|
||||
@ -53,6 +50,9 @@ void ColnodAPI::downloadData(const qint64 &time)
|
||||
// if I have all data emit downloadDataFinished
|
||||
connect(this, &ColnodAPI::partOfDataReady, this, &ColnodAPI::areDataReady);
|
||||
|
||||
Timestamp timestamp;
|
||||
timestamp.setTimestamp(time);
|
||||
|
||||
auto tokensRequest = getTokensUpdated(timestamp);
|
||||
connect(tokensRequest.get(), &serversdk::Request::finished, errorHandler);
|
||||
connect(tokensRequest.get(), &serversdk::Request::finished, [=](){
|
||||
|
||||
@ -90,8 +90,6 @@ bool SyncManager::startSynchronization()
|
||||
if (!database->processData(preparedData->databaseData)) {
|
||||
qCritical(syncmanager) << "Not possible to upload data to database";
|
||||
}
|
||||
colnod->processData(preparedData->colnodData);
|
||||
//qCritical(syncmanager) << "Not possible to upload data to colnod";
|
||||
|
||||
// data is processed to other sides
|
||||
connect(colnod.get(), &ColnodAPI::dataProcessFinished, [&](){
|
||||
@ -135,6 +133,9 @@ bool SyncManager::startSynchronization()
|
||||
QCoreApplication::exit();
|
||||
});
|
||||
|
||||
colnod->processData(preparedData->colnodData);
|
||||
//qCritical(syncmanager) << "Not possible to upload data to colnod";
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user