mirror of
https://github.com/syncthing/syncthing.git
synced 2026-09-12 22:19:17 -04:00
This commit is contained in:
1 parent
21c074cc2c
commit
d70eb569f2
1 file changed
+5
@@ -21,6 +21,11 @@ func SetLowPriority() error {
|
||||
}
|
||||
defer windows.CloseHandle(handle)
|
||||
|
||||
if cur, err := windows.GetPriorityClass(handle); err == nil && (cur == windows.IDLE_PRIORITY_CLASS || cur == windows.BELOW_NORMAL_PRIORITY_CLASS) {
|
||||
// We're done here.
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := windows.SetPriorityClass(handle, windows.BELOW_NORMAL_PRIORITY_CLASS); err != nil {
|
||||
return fmt.Errorf("set priority class: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user