This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from OcularEngineering/AddRateLimiter
Add Rate Limiter For Jira, Asana, Confluence, Slack
- Loading branch information
Showing
11 changed files
with
153 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { AppNameDefinitions, RateLimiterOpts} from "@ocular/types"; | ||
import { RateLimiterService} from "@ocular/ocular"; | ||
|
||
export default async (container, options) => { | ||
try { | ||
// Register Rate Limiter For Google Drive | ||
if (!options.rate_limiter_opts) { | ||
throw new Error("No options provided for rate limiter") | ||
} | ||
const rateLimiterOpts: RateLimiterOpts = options.rate_limiter_opts | ||
const rateLimiterService: RateLimiterService = container.resolve("rateLimiterService") | ||
await rateLimiterService.register(AppNameDefinitions.ASANA,rateLimiterOpts.requests, rateLimiterOpts.interval); | ||
} catch (err) { | ||
throw(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { AppNameDefinitions, RateLimiterOpts} from "@ocular/types"; | ||
import { RateLimiterService} from "@ocular/ocular"; | ||
|
||
export default async (container, options) => { | ||
try { | ||
// Register Rate Limiter For Google Drive | ||
if (!options.rate_limiter_opts) { | ||
throw new Error("No options provided for rate limiter") | ||
} | ||
const rateLimiterOpts: RateLimiterOpts = options.rate_limiter_opts | ||
const rateLimiterService: RateLimiterService = container.resolve("rateLimiterService") | ||
await rateLimiterService.register(AppNameDefinitions.CONFLUENCE,rateLimiterOpts.requests, rateLimiterOpts.interval); | ||
} catch (err) { | ||
throw(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { AppNameDefinitions, RateLimiterOpts} from "@ocular/types"; | ||
import { RateLimiterService} from "@ocular/ocular"; | ||
|
||
export default async (container, options) => { | ||
try { | ||
// Register Rate Limiter For Google Drive | ||
if (!options.rate_limiter_opts) { | ||
throw new Error("No options provided for rate limiter") | ||
} | ||
const rateLimiterOpts: RateLimiterOpts = options.rate_limiter_opts | ||
const rateLimiterService: RateLimiterService = container.resolve("rateLimiterService") | ||
await rateLimiterService.register(AppNameDefinitions.GITHUB, rateLimiterOpts.requests, rateLimiterOpts.interval); | ||
} catch (err) { | ||
throw(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { AppNameDefinitions, RateLimiterOpts} from "@ocular/types"; | ||
import { RateLimiterService} from "@ocular/ocular"; | ||
|
||
export default async (container, options) => { | ||
try { | ||
// Register Rate Limiter For Google Drive | ||
if (!options.rate_limiter_opts) { | ||
throw new Error("No options provided for rate limiter") | ||
} | ||
const rateLimiterOpts: RateLimiterOpts = options.rate_limiter_opts | ||
const rateLimiterService: RateLimiterService = container.resolve("rateLimiterService") | ||
console.log("Gmail: Rate Limiter Options", rateLimiterOpts) | ||
await rateLimiterService.register(AppNameDefinitions.JIRA,rateLimiterOpts.requests, rateLimiterOpts.interval); | ||
} catch (err) { | ||
console.log(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { AppNameDefinitions, RateLimiterOpts} from "@ocular/types"; | ||
import { RateLimiterService} from "@ocular/ocular"; | ||
|
||
export default async (container, options) => { | ||
try { | ||
// Register Rate Limiter For Google Drive | ||
if (!options.rate_limiter_opts) { | ||
throw new Error("No options provided for rate limiter") | ||
} | ||
const rateLimiterOpts: RateLimiterOpts = options.rate_limiter_opts | ||
const rateLimiterService: RateLimiterService = container.resolve("rateLimiterService") | ||
await rateLimiterService.register(AppNameDefinitions.SLACK,rateLimiterOpts.requests, rateLimiterOpts.interval); | ||
} catch (err) { | ||
throw(err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.