Use real UUIDs for pendingCoroutines
This commit is contained in:
parent
26e63e4ab2
commit
87a81ed1a7
|
@ -15,7 +15,7 @@ Python {
|
|||
}
|
||||
|
||||
function callCoro(name, args=[], onSuccess=null, onError=null) {
|
||||
let uuid = Math.random() + "." + name
|
||||
let uuid = name + "." + CppUtils.uuid()
|
||||
|
||||
pendingCoroutines[uuid] = {onSuccess, onError}
|
||||
call("APP.call_backend_coro", [name, uuid, args])
|
||||
|
@ -25,7 +25,7 @@ Python {
|
|||
accountId, name, args=[], onSuccess=null, onError=null
|
||||
) {
|
||||
callCoro("wait_until_client_exists", [accountId], () => {
|
||||
let uuid = Math.random() + "." + name
|
||||
let uuid = accountId + "." + name + "." + CppUtils.uuid()
|
||||
|
||||
pendingCoroutines[uuid] = {onSuccess, onError}
|
||||
call("APP.call_client_coro", [accountId, name, uuid, args])
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include <QLocale>
|
||||
#include <QDebug>
|
||||
#include <QUuid>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
|
@ -14,3 +14,8 @@ QString Utils::formattedBytes(qint64 bytes, int precision) {
|
|||
bytes, precision, QLocale::DataSizeTraditionalFormat
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
QString Utils::uuid() {
|
||||
return QUuid::createUuid().toString(QUuid::WithoutBraces);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ public:
|
|||
|
||||
public slots:
|
||||
QString formattedBytes(qint64 bytes, int precision = 2);
|
||||
QString uuid();
|
||||
|
||||
private:
|
||||
QLocale m_locale;
|
||||
|
|
Loading…
Reference in New Issue
Block a user