sync: add on-command sync

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-08-21 22:44:35 -06:00
parent 24d0d4687a
commit 8b8b689187
10 changed files with 263 additions and 32 deletions
+9
View File
@@ -42,6 +42,12 @@ type TelegramConfig struct {
IntervalSeconds int `yaml:"interval_seconds"`
TimeoutSeconds int `yaml:"timeout_seconds"`
} `yaml:"ping"`
Sync struct {
UpdateLimit int `yaml:"update_limit"`
CreateLimit int `yaml:"create_limit"`
DirectChats bool `yaml:"direct_chats"`
} `yaml:"sync"`
}
func (c TelegramConfig) ShouldBridge(participantCount int) bool {
@@ -65,6 +71,9 @@ func upgradeConfig(helper up.Helper) {
helper.Copy(up.Int, "max_member_count")
helper.Copy(up.Int, "ping", "interval_seconds")
helper.Copy(up.Int, "ping", "timeout_seconds")
helper.Copy(up.Int, "sync", "update_limit")
helper.Copy(up.Int, "sync", "create_limit")
helper.Copy(up.Bool, "sync", "direct_chats")
}
func (tg *TelegramConnector) GetConfig() (example string, data any, upgrader up.Upgrader) {