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