-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
wontfixThis will not be worked onThis will not be worked on
Description
If the database server is slow and takes a long time to process transactions, attempting to process a large number of transactions will create a large number of connections and cause the server to crash due to lack of memory.
Using slow database, you can reproduce it with code like this
use SOFe\Capital\{Capital, CapitalException, LabelSet};
Capital::api("0.1.0", function(Capital $api){
$this->selector = $api->completeConfig(["currency" => "money"]);
});
$this->getScheduler()->scheduleRepeatingTask(new ClosureTask(function(){
foreach($this->getServer()->getOnlinePlayers() as $player){
Capital::api("0.1.0", function(Capital $api) use ($player){
yield from $api->addMoney($this->getName(), $player, $this->selector, 1, new LabelSet([]));
});
}
}), 1);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
wontfixThis will not be worked onThis will not be worked on