1

fix: ErrorAlreadyExists 1832->183, wrap syscall errors, signal handling, mutex cleanup, log sync

This commit is contained in:
2026-06-20 23:41:59 +03:00
parent 33dfd4b4c5
commit d4da33ca5e
5 changed files with 74 additions and 29 deletions
+20 -9
View File
@@ -1,9 +1,13 @@
# autoPriority
Automatically sets high CPU priority for memory-heavy processes.
Automatically sets high CPU priority for processes exceeding a memory threshold.
**Windows only.**
## Build
Requires Go 1.26+.
```
# Standard build (with console window)
go build -o autopriority.exe .
@@ -20,18 +24,25 @@ autopriority [flags]
| Flag | Default | Description |
|-------------|---------------|----------------------------------|
| `-mem` | 536870912 | Memory threshold in bytes |
| `-interval` | 1m0s | Scan interval (min 10s) |
| `-mem` | 536870912 | Memory threshold in bytes (512 MB) |
| `-interval` | 1 minute | Scan interval (min 10s) |
| `-dry-run` | false | Log only, don't change priority |
| `-log` | true | Write `autopriority.log` to `%TEMP%` |
Examples:
```
# Run with 1 GB memory threshold, scanning every 30 seconds
autopriority -mem=1073741824 -interval=30s
# Dry run — log decisions without changing anything
autopriority -dry-run
```
Log is always written to `%TEMP%\autopriority.log`.
## Auto-start
Place a shortcut to `autopriority.exe` in:
```
shell:startup
```
Open **Win+R**, type `shell:startup`, and press Enter. Then place a shortcut to `autopriority.exe` in the folder that opens.
## Dependencies