diff options
| author | 2019-07-22 12:42:43 +0100 | |
|---|---|---|
| committer | 2019-07-22 12:42:43 +0100 | |
| commit | 92c76766f54c35b18f128c94e031d78f97e474ad (patch) | |
| tree | 544d48efe8402c43847d5c6344a54f1cf72e46ed | |
| parent | Remove debug print from perform.py (diff) | |
| signature | ||
batch up channel_save.py JOINs in to groups of 10
| -rw-r--r-- | modules/channel_save.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/channel_save.py b/modules/channel_save.py index b3133843..d5b69638 100644 --- a/modules/channel_save.py +++ b/modules/channel_save.py @@ -1,11 +1,16 @@ from src import ModuleManager, utils +BATCH_MAX = 10 + class Module(ModuleManager.BaseModule): @utils.hook("received.001") def on_connect(self, event): channels = event["server"].get_setting("autojoin", []) if channels: - event["server"].send_joins(channels) + channel_batches = [channels[i:i+BATCH_MAX] for i in range( + 0, len(channels), BATCH_MAX)] + for channel_batch in channel_batches: + event["server"].send_joins(channel_batch) @utils.hook("self.join") def on_join(self, event): |
