Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Framework] Caching port app config #628

Merged
merged 12 commits into from
May 16, 2024
Merged

[Framework] Caching port app config #628

merged 12 commits into from
May 16, 2024

Conversation

omby8888
Copy link
Contributor

@omby8888 omby8888 commented May 15, 2024

Description

What - Caching port app config
Why - To reduce requests to port-api
How - Save the config in a class attribute and update if previous config request was more than a minute ago

Saves average of 1 second in response time for real time events when overloaded

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.

@github-actions github-actions bot added size/M and removed size/S labels May 15, 2024
Copy link
Collaborator

@yairsimantov20 yairsimantov20 left a comment

Choose a reason for hiding this comment

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

🌊



class PortAppConfigCache:
_port_app_config: PortAppConfig
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
_port_app_config: PortAppConfig
_port_app_config: PortAppConfig | None

CHANGELOG.md Outdated

### Improvements

- Added caching to port-app-config.yml retrieval from port api
Copy link
Collaborator

Choose a reason for hiding this comment

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

specify that itll only be used for live events


### Improvements

- Added caching to port-app-config.yml retrieval from port api (only for live events)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Added caching to port-app-config.yml retrieval from port api (only for live events)
- Added caching to port-app-config.yml retrieval from port api (Applied only for non resync integration events like live events)

@omby8888 omby8888 merged commit 9fcf024 into main May 16, 2024
4 checks passed
@omby8888 omby8888 deleted the caching-port-app-config branch May 16, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants