diff --git a/Instagram Reels Bot/Services/Subscriptions.cs b/Instagram Reels Bot/Services/Subscriptions.cs index 410efcc..64b1a3b 100644 --- a/Instagram Reels Bot/Services/Subscriptions.cs +++ b/Instagram Reels Bot/Services/Subscriptions.cs @@ -431,9 +431,14 @@ public async Task GetLatestsPosts() } //Update database: await this.FollowedAccountsContainer.ReplaceOneAsync(x => x.InstagramID == dbfeed.InstagramID, dbfeed, new ReplaceOptions { IsUpsert = true }); - // Wait to prevent spamming IG api: - // 10 seconds - await Task.Delay(10000); + + // Wait to prevent spamming IG api + // Get value from config: + int time = 10; + int.TryParse(_config["SubscribeCheckDelayTime"], out time); + // Enforce a minimum of 10 seconds. + time = Math.Max(time, 10); + await Task.Delay(time * 1000); } } catch(Exception e) diff --git a/README.md b/README.md index 407dd50..a1875af 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Create a new file named `config.json`, copy and paste the contents below into it "AllowSubscriptions": true/false, "MongoDBUrl": "MongoDB Connection String (Required for subscriptions)", "DefaultSubscriptionsPerGuildMax": 1, - "HoursToCheckForNewContent": 3 + "HoursToCheckForNewContent": 3, + "SubscribeCheckDelayTime": 10 } ```