Fix HubManager, add failsafe for BoosterManager
This commit is contained in:
parent
fd843b88cb
commit
def57e2c0b
@ -120,7 +120,6 @@ public class BoosterManager extends MiniPlugin
|
||||
Map<String, List<Booster>> boosters = _repository.getBoosters();
|
||||
long timeTaken = System.currentTimeMillis() - time;
|
||||
runSync(() -> {
|
||||
|
||||
handleBoosterUpdate(boosters);
|
||||
if (callback != null) callback.run(boosters);
|
||||
});
|
||||
@ -219,11 +218,16 @@ public class BoosterManager extends MiniPlugin
|
||||
@EventHandler
|
||||
public void tickBoosters(UpdateEvent event)
|
||||
{
|
||||
if (event.getType() != UpdateType.SEC)
|
||||
return;
|
||||
|
||||
if (event.getType() == UpdateType.MIN_10)
|
||||
{
|
||||
// sync with API every 10 minutes, incase pubsub fails
|
||||
getBoostersAsync(null);
|
||||
}
|
||||
else if (event.getType() == UpdateType.SEC)
|
||||
{
|
||||
tickBoosterCache();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return all boosters for the active booster group
|
||||
|
@ -229,7 +229,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
FacebookManager facebookManager = new FacebookManager(plugin, clientManager, donationManager, inventoryManager);
|
||||
_bonusManager = new BonusManager(plugin, clientManager, serverStatusManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager, facebookManager, _gadgetManager, boosterManager);
|
||||
|
||||
_treasureManager = new TreasureManager(_plugin, clientManager, serverStatusManager, donationManager, _inventoryManager, petManager, _blockRestore, hologramManager, statsManager, _bonusManager.getRewardManager());
|
||||
_treasureManager = new TreasureManager(_plugin, clientManager, serverStatusManager, donationManager, _inventoryManager, petManager, _gadgetManager, _blockRestore, hologramManager, statsManager, _bonusManager.getRewardManager());
|
||||
new CosmeticManager(_plugin, clientManager, donationManager, _inventoryManager, _gadgetManager, _mountManager, petManager, _treasureManager, boosterManager);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user