Commit 464cb13
fix: replace deprecated returnResource() and add JedisPool shutdown hook (#1188)
Two resource management issues fixed:
1. returnConnection() used jedisPool.returnResource() which has been
deprecated since Jedis 3.0. Replaced with jedis.close() which correctly
returns healthy connections to the pool and closes broken ones.
2. JedisPool was never closed, leaving open connections and background
threads after process exit. Added closePool() and a JVM shutdown hook
to ensure the pool is always properly released on shutdown.
Co-authored-by: Claude <claude@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent ddd4c73 commit 464cb13
File tree
1 file changed
+32
-5
lines changed- platform-core/platform-cache/src/main/scala/org/sunbird/cache/util
1 file changed
+32
-5
lines changedLines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
32 | 37 | | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
36 | | - | |
37 | | - | |
38 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
39 | 59 | | |
40 | 60 | | |
41 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
42 | 69 | | |
43 | 70 | | |
44 | 71 | | |
45 | | - | |
| 72 | + | |
46 | 73 | | |
47 | 74 | | |
48 | 75 | | |
0 commit comments