Skip to content

Commit ff51528

Browse files
committed
@pcrespov @sanderegg use APP_NAME in doc string
1 parent dbaf0fd commit ff51528

File tree

1 file changed

+5
-3
lines changed
  • packages/service-library/src/servicelib/celery

1 file changed

+5
-3
lines changed

packages/service-library/src/servicelib/celery/models.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
)
3434

3535
Wildcard: TypeAlias = Literal["*"]
36+
WILDCARD: Final[Wildcard] = "*"
3637

3738

3839
class OwnerMetadata(BaseModel):
@@ -47,10 +48,11 @@ class OwnerMetadata(BaseModel):
4748
class StorageOwnerMetadata(OwnerMetadata):
4849
user_id: int | Wildcard
4950
product_name: int | Wildcard
50-
owner = "storage-service"
51+
owner = APP_NAME
5152
52-
Listing tasks using the filter `StorageOwnerMetadata(user_id=123, product_name="*")` will return all tasks with
53-
user_id 123, any product_name submitted from storage-service.
53+
Where APP_NAME is the name of the service. Listing tasks using the filter
54+
`StorageOwnerMetadata(user_id=123, product_name=WILDCARD)` will return all tasks with
55+
user_id 123, any product_name submitted from the service.
5456
5557
If the metadata schema is known, the class allows deserializing the metadata (recreate_as_model). I.e. one can recover the metadata from the task:
5658
metadata -> task_uuid -> metadata

0 commit comments

Comments
 (0)