From bee9e18c3af284ff432a4472f1d409f5a6dc09a7 Mon Sep 17 00:00:00 2001 From: zhizhijie <zhizhijie@users.noreply.gitee.com> Date: 星期二, 06 十月 2026 16:59:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/main' --- deploy-templates/backend/trafficAudit.xml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/deploy-templates/backend/trafficAudit.xml b/deploy-templates/backend/trafficAudit.xml new file mode 100644 index 0000000..43e5234 --- /dev/null +++ b/deploy-templates/backend/trafficAudit.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + WinSW (Windows Service Wrapper) configuration for the TrafficAudit backend. + + Layout requirement: this file MUST stay in the same folder as the wrapper + executable named trafficAudit.exe, the application jar, application.yml, + docs\ and web\. WinSW looks for a config file whose name matches the + executable (trafficAudit.exe -> trafficAudit.xml). + + %BASE% is expanded by WinSW to the folder that holds this file, so the + service always runs with that folder as its working directory. + + The executable element below is rewritten with an absolute java.exe path by + install-service.ps1 (a SYSTEM service does not inherit the interactive + user PATH, so relying on PATH alone is fragile). +--> +<service> + <id>TrafficAuditBackend</id> + <name>TrafficAudit Backend</name> + <description>TrafficAudit freight statistics audit backend (Spring Boot, HTTP port 8090).</description> + + <executable>java.exe</executable> + <arguments>-Dfile.encoding=UTF-8 -jar "%BASE%\traffic-audit-server.jar"</arguments> + <workingdirectory>%BASE%</workingdirectory> + + <!-- Start at boot, but delayed so a local MySQL service is ready first. --> + <startmode>Automatic</startmode> + <delayedAutoStart>true</delayedAutoStart> + + <!-- Restart on crash: quickly at first, then back off. Counter resets after 1 hour. --> + <onfailure action="restart" delay="10 sec"/> + <onfailure action="restart" delay="30 sec"/> + <onfailure action="restart" delay="60 sec"/> + <resetfailure>1 hour</resetfailure> + + <stoptimeout>30 sec</stoptimeout> + + <logpath>%BASE%\logs</logpath> + <log mode="roll-by-size"> + <sizeThreshold>10240</sizeThreshold> + <keepFiles>10</keepFiles> + </log> + <outfile>trafficAudit.out.log</outfile> + <errfile>trafficAudit.err.log</errfile> +</service> -- Gitblit v1.9.1