Commit Graph

8 Commits

Author SHA1 Message Date
Torsten Schulz (local)
6d12c70d84 Entferne Info-Logs aus den Worker-Klassen: Reduziere die Protokollierung in ProduceWorker, DirectorWorker und TransportWorker, um die Ausgabe zu optimieren und nur Fehler zu protokollieren. 2025-12-16 12:58:37 +01:00
Torsten Schulz (local)
10bc1e5a52 Refactor SQL queries into a dedicated module
- Moved SQL queries from multiple worker files into `src/worker/sql.rs` for better organization and maintainability.
- Updated references in `stockage_manager.rs`, `transport.rs`, `underground.rs`, `user_character.rs`, and `value_recalculation.rs` to use the new centralized SQL queries.
- Improved code readability by replacing `.get(0)` with `.first()` for better clarity when retrieving the first row from query results.
- Cleaned up unnecessary comments and consolidated related SQL queries.
2025-12-13 11:57:28 +01:00
Torsten Schulz (local)
8db82e0ced Refactor transport planning in DirectorWorker: Updated variable naming for clarity by changing 'shipped' to '_shipped' to indicate unused variable. Removed unused get_branch_user_id function from TransportWorker to streamline code and improve maintainability. 2025-12-05 14:20:56 +01:00
Torsten Schulz (local)
f481ef4b73 Refactor inventory handling in DirectorWorker: Updated transport planning logic to ensure inventory is reduced immediately after successful transport creation. Removed redundant inventory updates from the planning phase, enhancing consistency and clarity in inventory management. Improved logging to reflect changes in inventory status during transport operations. 2025-12-05 14:17:57 +01:00
Torsten Schulz (local)
d03d865f75 Refactor ArrivedTransport struct and SQL query in TransportWorker: Updated the ArrivedTransport struct to include source and target branch IDs, and user ID for notifications. Modified the SQL query to join with source and target branches, enhancing transport data retrieval and notification capabilities. 2025-12-05 14:15:22 +01:00
Torsten Schulz (local)
58436bc016 Enhance transport processing in TransportWorker: Updated run_loop and process_arrived_transports methods to include broker for publishing notifications. Improved handling of empty transports and added notifications for transport arrival and inventory updates, ensuring timely user alerts and better transport management. 2025-12-05 14:12:17 +01:00
Torsten Schulz (local)
fbcea09257 Refactor transport handling in TransportWorker: Updated ArrivedTransport struct to allow optional product_id for empty transports. Enhanced validation logic to differentiate between normal and empty transports, improving handling and processing of transport data. Added specific handling for empty transports in the database operations, ensuring accurate vehicle updates and transport deletions. 2025-12-05 14:06:22 +01:00
Torsten Schulz (local)
8ee0bbf3cd Add TransportWorker and enhance logging: Introduced TransportWorker to the worker module and improved shutdown logging in the daemon for better visibility during system termination. Updated watchdog thread sleep mechanism for quicker shutdown response and refined error handling in DbError conversion to include SQLSTATE as a string. 2025-11-26 16:03:27 +01:00