mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-15 10:57:47 -05:00
Merge remote-tracking branch 'origin/develop' into 3218-official-prom
This commit is contained in:
commit
754826a830
47 changed files with 686 additions and 197 deletions
|
|
@ -17,6 +17,9 @@ from prometheus_client.core import Gauge, REGISTRY, GaugeMetricFamily
|
|||
|
||||
import os
|
||||
|
||||
from six.moves import intern
|
||||
import six
|
||||
|
||||
CACHE_SIZE_FACTOR = float(os.environ.get("SYNAPSE_CACHE_FACTOR", 0.5))
|
||||
|
||||
caches_by_name = {}
|
||||
|
|
@ -110,7 +113,9 @@ def intern_string(string):
|
|||
return None
|
||||
|
||||
try:
|
||||
string = string.encode("ascii")
|
||||
if six.PY2:
|
||||
string = string.encode("ascii")
|
||||
|
||||
return intern(string)
|
||||
except UnicodeEncodeError:
|
||||
return string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue