Switch to using ULIDs for context_ids (#70246)
This commit is contained in:
parent
1da7927fbb
commit
d03760d0bb
3 changed files with 38 additions and 2 deletions
|
@ -72,7 +72,7 @@ from .exceptions import (
|
|||
ServiceNotFound,
|
||||
Unauthorized,
|
||||
)
|
||||
from .util import dt as dt_util, location, uuid as uuid_util
|
||||
from .util import dt as dt_util, location, ulid as ulid_util
|
||||
from .util.async_ import (
|
||||
fire_coroutine_threadsafe,
|
||||
run_callback_threadsafe,
|
||||
|
@ -696,7 +696,7 @@ class Context:
|
|||
|
||||
user_id: str | None = attr.ib(default=None)
|
||||
parent_id: str | None = attr.ib(default=None)
|
||||
id: str = attr.ib(factory=uuid_util.random_uuid_hex)
|
||||
id: str = attr.ib(factory=ulid_util.ulid_hex)
|
||||
|
||||
def as_dict(self) -> dict[str, str | None]:
|
||||
"""Return a dictionary representation of the context."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue