Skip to content

Conversation

karen-stepanyan
Copy link
Contributor

Closes #ISSUE_NUMBER_GOES_HERE

Description

......

Changes

  • High level
  • changes that
  • you made

Steps to Test

  1. Steps
  2. to
  3. test

Quality Assurance

  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant infra-k8s configuration file.
  • If a new adapter was made, or an existing one was modified so that its environment variables have changed, update the relevant adapter-secrets configuration file or update the soak testing blacklist.
  • If a new adapter was made, or a new endpoint was added, update the test-payload.json file with relevant requests.
  • The branch naming follows git flow (feature/x, chore/x, release/x, hotfix/x, fix/x) or is created from Jira.
  • This is related to a maximum of one Jira story or GitHub issue.
  • Types are safe (avoid TypeScript/TSLint features like any and disable, instead use more specific types).
  • All code changes have 100% unit and integration test coverage. If testing is not applicable or too difficult to justify doing, the reasoning should be documented explicitly in the PR.

Copy link

changeset-bot bot commented Sep 22, 2025

⚠️ No Changeset found

Latest commit: 80fd240

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

API_FREQUENCY: {
description: 'Frequency of API calls in minutes',
type: 'number',
default: 20,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the default 2, as we know that works

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since there is no background process limiting here, why not 20 minutes for 6 requests ? essentially 3.3 minute per request

sensitive: true,
},
API_FREQUENCY: {
description: 'Frequency of API calls in minutes',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be per minute?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for CRON, can be minutes or seconds I don't have preference

schedule.scheduleJob(`0 */${this.settings.API_FREQUENCY} * * * *`, async () => {
logger.info(`Scheduled execution started at ${Date.now()}`)
for (let i = 0; i < this.params.length; i++) {
await this.executeRequest(this.params[i])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this call the subscriptions one after the other? Does it wait 60/API_FREQUENCY seconds?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, so this is make a burst of requests (once the previous one is fetched)

}

runScheduler() {
schedule.scheduleJob(`0 */${this.settings.API_FREQUENCY} * * * *`, async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How often does this make it run the cron? The superstate EA uses a const rule = new schedule.RecurrenceRule() I would be in favour of doing the same.

Copy link
Contributor Author

@karen-stepanyan karen-stepanyan Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this runs every this.settings.API_FREQUENCY minutes. superstate uses slightly different logic (runs at a specific time per day) so that's why it's different rule.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Karen explained, standard cron syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants