dify/api/services
Harry d5ff89f6d3 refactor(api): enhance request handling and time management
- Initialized `response` variable in `trigger.py` to ensure proper handling in the trigger endpoint.
- Updated `http_parser.py` to conditionally set `CONTENT_TYPE` and `CONTENT_LENGTH` headers for improved robustness.
- Changed `datetime.utcnow()` to `datetime.now(UTC)` in `sqlalchemy_workflow_trigger_log_repository.py` and `rate_limiter.py` for consistent time zone handling.
- Refactored `async_workflow_service.py` to use the public method `get_tenant_owner_timezone` for better encapsulation.
- Simplified subscription retrieval logic in `plugin_parameter_service.py` for clarity.

These changes improve code reliability and maintainability while ensuring accurate time management and request processing.
2025-09-25 19:46:52 +08:00
..
auth more httpx (#25651) 2025-09-22 23:07:09 +08:00
enterprise feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
entities fix full_text_search name (#26104) 2025-09-23 16:40:26 +08:00
errors Merge remote-tracking branch 'origin/main' into feat/trigger 2025-09-25 17:14:24 +08:00
plugin refactor(api): enhance request handling and time management 2025-09-25 19:46:52 +08:00
rag_pipeline Fix: use data.type instead of type when checking datasource node (#25965) 2025-09-22 10:01:21 +08:00
recommend_app chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
tools refactor(api): refactor all 2025-09-25 18:22:30 +08:00
trigger refactor(api): refactor all 2025-09-25 18:22:30 +08:00
workflow refactor(api): enhance request handling and time management 2025-09-25 19:46:52 +08:00
__init__.py chore(api/services): apply ruff reformatting (#7599) 2024-08-26 13:43:57 +08:00
account_service.py fix: remove billing cache when add or delete app or member (#25885) 2025-09-18 12:18:07 +08:00
advanced_prompt_template_service.py chore: adopt StrEnum and auto() for some string-typed enums (#25129) 2025-09-12 21:14:26 +08:00
agent_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
annotation_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
api_based_extension_service.py remove bare list, dict, Sequence, None, Any (#25058) 2025-09-06 03:32:23 +08:00
app_dsl_service.py Merge remote-tracking branch 'origin/main' into feat/trigger 2025-09-25 17:14:24 +08:00
app_generate_service.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
app_model_config_service.py remove bare list, dict, Sequence, None, Any (#25058) 2025-09-06 03:32:23 +08:00
app_service.py one example of Session (#24135) 2025-09-24 03:32:48 +08:00
async_workflow_service.py refactor(api): enhance request handling and time management 2025-09-25 19:46:52 +08:00
audio_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
billing_service.py fix: remove billing cache when add or delete app or member (#25885) 2025-09-18 12:18:07 +08:00
clear_free_plan_tenant_expired_logs.py update sql in batch (#24801) 2025-09-10 13:00:17 +08:00
code_based_extension_service.py remove bare list, dict, Sequence, None, Any (#25058) 2025-09-06 03:32:23 +08:00
conversation_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
dataset_service.py one example of Session (#24135) 2025-09-24 03:32:48 +08:00
datasource_provider_service.py refactor(api): refactor all 2025-09-25 18:22:30 +08:00
external_knowledge_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
feature_service.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
file_service.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
hit_testing_service.py remove bare list, dict, Sequence, None, Any (#25058) 2025-09-06 03:32:23 +08:00
knowledge_service.py feat: mypy for all type check (#10921) 2024-12-24 18:38:51 +08:00
message_service.py fix: Message => str (#25876) 2025-09-18 17:57:57 +08:00
metadata_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
model_load_balancing_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
model_provider_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
oauth_server.py feat: oauth provider (#24206) 2025-08-29 14:10:51 +08:00
operation_service.py more httpx (#25651) 2025-09-22 23:07:09 +08:00
ops_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
recommended_app_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
saved_message_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
schedule_service.py feat: add workflow schedule trigger support (#24428) 2025-09-10 13:24:23 +08:00
tag_service.py one example of Session (#24135) 2025-09-24 03:32:48 +08:00
trigger_debug_service.py feat(trigger): implement plugin trigger synchronization and subscription management in workflow 2025-09-15 15:49:07 +08:00
trigger_service.py refactor(api): refactor all 2025-09-25 18:22:30 +08:00
variable_truncator.py fix(api): Fix variable truncation for `list[File]` value in output mapping (#26133) 2025-09-23 21:30:46 +08:00
vector_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
web_conversation_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
webapp_auth_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
webhook_service.py refactor(api): refactor all 2025-09-25 18:22:30 +08:00
website_service.py more httpx (#25651) 2025-09-22 23:07:09 +08:00
workflow_app_service.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
workflow_draft_variable_service.py feat: knowledge pipeline (#25360) 2025-09-18 12:49:10 +08:00
workflow_plugin_trigger_service.py refactor(api): refactor all 2025-09-25 18:22:30 +08:00
workflow_run_service.py chore: add ast-grep rule to convert Optional[T] to T | None (#25560) 2025-09-15 13:06:33 +08:00
workflow_service.py Merge remote-tracking branch 'origin/main' into feat/trigger 2025-09-25 17:14:24 +08:00
workspace_service.py Fix basedpyright type errors (#25435) 2025-09-10 01:54:26 +08:00