mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
New ResourceManager for managing server load.
* Track abusive endpoints * Gossip across cluster. * Use resource manager's gossip support to share load reporting across a cluster * Swtich from legacy fees to new Resource::Charge fees. * Connect RPC to the new resource manager. * Set load levels where needed in RPC/websocket commands. * Disconnect abusive peer endpoints. * Don't start conversations with abusive peer endpoints. * Move Resource::Consumer to InfoSub and remove LoadSource * Remove port from inbound Consumer keys * Add details in getJson * Fix doAccountCurrencies for the new resource manager.
This commit is contained in:
committed by
Vinnie Falco
parent
a05f33f6a7
commit
58f07a573f
@@ -87,11 +87,15 @@ std::string Consumer::to_string () const
|
||||
|
||||
bool Consumer::admin () const
|
||||
{
|
||||
return m_entry->admin();
|
||||
if (m_entry != nullptr)
|
||||
return m_entry->admin();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Consumer::elevate (std::string const& name)
|
||||
{
|
||||
bassert (m_entry != nullptr);
|
||||
m_entry = &m_logic->elevateToAdminEndpoint (*m_entry, name);
|
||||
}
|
||||
|
||||
@@ -102,26 +106,31 @@ Disposition Consumer::disposition() const
|
||||
|
||||
Disposition Consumer::charge (Charge const& what)
|
||||
{
|
||||
bassert (m_entry != nullptr);
|
||||
return m_logic->charge (*m_entry, what);
|
||||
}
|
||||
|
||||
bool Consumer::warn ()
|
||||
{
|
||||
bassert (m_entry != nullptr);
|
||||
return m_logic->warn (*m_entry);
|
||||
}
|
||||
|
||||
bool Consumer::disconnect ()
|
||||
{
|
||||
bassert (m_entry != nullptr);
|
||||
return m_logic->disconnect (*m_entry);
|
||||
}
|
||||
|
||||
int Consumer::balance()
|
||||
{
|
||||
bassert (m_entry != nullptr);
|
||||
return m_logic->balance (*m_entry);
|
||||
}
|
||||
|
||||
Entry& Consumer::entry()
|
||||
{
|
||||
bassert (m_entry != nullptr);
|
||||
return *m_entry;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user