Kong / Kong/kong-python-pdk

Increasing 60sec ttl on closing of plugin instance

Open
#29 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
48
Forks
16
PR merge metrics
No merged PRs in 30d

Description

I see there is 60 sec ttl on plugin instances, so if no requests are being send for 60 sec then supposedly the plugin instance will be closed. Is there a way to increase this ttl ?
My custom plugin is using some sort of internal lru cache which is being initialised in the plugin constructor. So if the plugin is closed that cache will also be reset and new instance will be created with empty cache.
```
self.cache = LRUCache(capacity=self.config['lru_cache_capacity'], max_age_seconds=self.config['lru_cache_max_age_seconds'])
```
Using the above cache in my `access` method before calling the database.

I understand this is not the best design and cache should be separated out from the plugin code. But currently I am stuck with this.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no repository file or test; start by tracing the plugin instance lifecycle around the 60-second TTL, then inspect the plugin constructor and access method described in the report. Done means establishing whether the TTL can be configured and documenting or implementing a supported way to increase it without losing the plugin's internal cache.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.