Fix PubSub client creation/pending topic resolving (#3037)
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com> Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com> Co-authored-by: zneix <zneix@zneix.eu>
This commit is contained in:
@@ -27,6 +27,20 @@ public:
|
||||
reinterpret_cast<int64_t &>(it.value())++;
|
||||
}
|
||||
}
|
||||
static void increase(const QString &name, const int64_t &amount)
|
||||
{
|
||||
auto counts = counts_.access();
|
||||
|
||||
auto it = counts->find(name);
|
||||
if (it == counts->end())
|
||||
{
|
||||
counts->insert(name, amount);
|
||||
}
|
||||
else
|
||||
{
|
||||
reinterpret_cast<int64_t &>(it.value()) += amount;
|
||||
}
|
||||
}
|
||||
|
||||
static void decrease(const QString &name)
|
||||
{
|
||||
@@ -42,6 +56,20 @@ public:
|
||||
reinterpret_cast<int64_t &>(it.value())--;
|
||||
}
|
||||
}
|
||||
static void decrease(const QString &name, const int64_t &amount)
|
||||
{
|
||||
auto counts = counts_.access();
|
||||
|
||||
auto it = counts->find(name);
|
||||
if (it == counts->end())
|
||||
{
|
||||
counts->insert(name, -amount);
|
||||
}
|
||||
else
|
||||
{
|
||||
reinterpret_cast<int64_t &>(it.value()) -= amount;
|
||||
}
|
||||
}
|
||||
|
||||
static QString getDebugText()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user