Kekik 1.6.4__tar.gz → 1.6.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Kekik might be problematic. Click here for more details.
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/cache.py +25 -2
- {kekik-1.6.4 → kekik-1.6.5}/Kekik.egg-info/PKG-INFO +1 -1
- {kekik-1.6.4 → kekik-1.6.5}/PKG-INFO +1 -1
- {kekik-1.6.4 → kekik-1.6.5}/setup.py +1 -1
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/BIST.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Domain2IP.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Nesne.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Sifreleme/AESManager.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Sifreleme/CryptoJS.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Sifreleme/HexCodec.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Sifreleme/NaysHash.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Sifreleme/Packer.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Sifreleme/StringCodec.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/Sifreleme/__init__.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/__init__.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/cli.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/csv2dict.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/dict2csv.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/dict2json.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/dosya2set.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/dosya_indir.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/hwid_kontrol.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/kisi_ver/__init__.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/kisi_ver/biyografiler.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/kisi_ver/isimler.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/kisi_ver/soyisimler.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/link_islemleri.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/list2html.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/liste_fetis.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/mail_gonder.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/okunabilir_byte.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/proxy_ver.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/qr_ver.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/ses_fetis.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/slugify.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/terminal_baslik.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/txt_fetis.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/unicode_tr.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik/zaman_donustur.py +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik.egg-info/SOURCES.txt +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik.egg-info/dependency_links.txt +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik.egg-info/entry_points.txt +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik.egg-info/requires.txt +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/Kekik.egg-info/top_level.txt +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/LICENSE +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/MANIFEST.in +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/README.md +0 -0
- {kekik-1.6.4 → kekik-1.6.5}/setup.cfg +0 -0
|
@@ -11,7 +11,7 @@ UNLIMITED = None
|
|
|
11
11
|
class Cache:
|
|
12
12
|
"""
|
|
13
13
|
Basit in-memory cache yapısı.
|
|
14
|
-
TTL (time-to-live) süresi dolan veriler otomatik olarak temizlenir.
|
|
14
|
+
TTL (time-to-live) süresi dolan veriler otomatik olarak temizlenir (get/erişim anında kontrol edilir).
|
|
15
15
|
"""
|
|
16
16
|
def __init__(self, ttl=UNLIMITED):
|
|
17
17
|
self._data = {}
|
|
@@ -49,11 +49,34 @@ class AsyncCache(Cache):
|
|
|
49
49
|
"""
|
|
50
50
|
Asenkron işlemleri destekleyen cache yapısı.
|
|
51
51
|
Aynı key için gelen eşzamanlı çağrılar, futures kullanılarak tek sonuç üzerinden paylaşılır.
|
|
52
|
+
Ek olarak, belirli aralıklarla cache’i kontrol edip, süresi dolmuş verileri temizleyen otomatik temizleme görevi çalışır.
|
|
52
53
|
"""
|
|
53
|
-
def __init__(self, ttl=UNLIMITED):
|
|
54
|
+
def __init__(self, ttl=UNLIMITED, cleanup_interval=60 * 60):
|
|
55
|
+
"""
|
|
56
|
+
:param ttl: Her entry için geçerli süre (saniye). Örneğin 3600 saniye 1 saattir.
|
|
57
|
+
:param cleanup_interval: Otomatik temizleme görevinin kaç saniyede bir çalışacağını belirler.
|
|
58
|
+
"""
|
|
54
59
|
super().__init__(ttl)
|
|
55
60
|
self.futures = {}
|
|
56
61
|
|
|
62
|
+
if ttl is not UNLIMITED:
|
|
63
|
+
# TTL geçerli bir sayı olduğunda cleanup interval, ttl ile cleanup_interval'ın max'ı olarak ayarlanır.
|
|
64
|
+
self._cleanup_interval = max(ttl, cleanup_interval)
|
|
65
|
+
else:
|
|
66
|
+
# TTL tanımsız (UNLIMITED) ise cleanup_interval doğrudan kullanılır.
|
|
67
|
+
self._cleanup_interval = cleanup_interval
|
|
68
|
+
|
|
69
|
+
self._cleanup_task = asyncio.create_task(self._auto_cleanup())
|
|
70
|
+
|
|
71
|
+
async def _auto_cleanup(self):
|
|
72
|
+
"""Belirlenen aralıklarla cache içerisindeki süresi dolmuş entry'leri temizler."""
|
|
73
|
+
while True:
|
|
74
|
+
await asyncio.sleep(self._cleanup_interval)
|
|
75
|
+
# _data kopyasını almak, üzerinde dönüp silme yaparken hata almamak için.
|
|
76
|
+
keys = list(self._data.keys())
|
|
77
|
+
for key in keys:
|
|
78
|
+
self.remove_if_expired(key)
|
|
79
|
+
|
|
57
80
|
async def get(self, key):
|
|
58
81
|
"""
|
|
59
82
|
Belirtilen key için cache'de saklanan değeri asenkron olarak döndürür.
|
|
@@ -6,7 +6,7 @@ from io import open
|
|
|
6
6
|
setup(
|
|
7
7
|
# ? Genel Bilgiler
|
|
8
8
|
name = "Kekik",
|
|
9
|
-
version = "1.6.
|
|
9
|
+
version = "1.6.5",
|
|
10
10
|
url = "https://github.com/keyiflerolsun/Kekik",
|
|
11
11
|
description = "İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..",
|
|
12
12
|
keywords = ["Kekik", "KekikAkademi", "keyiflerolsun"],
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|