Skip to content

Commit d4cd4ed

Browse files
authored
Restrict modules/graceful to non-windows build and shim the IsChild marker (#8537)
1 parent fcb535c commit d4cd4ed

File tree

8 files changed

+25
-0
lines changed

8 files changed

+25
-0
lines changed

modules/graceful/cleanup.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
// Copyright 2019 The Gitea Authors. All rights reserved.
24
// Use of this source code is governed by a MIT-style
35
// license that can be found in the LICENSE file.

modules/graceful/graceful_windows.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// +build windows
2+
3+
// Copyright 2019 The Gitea Authors. All rights reserved.
4+
// Use of this source code is governed by a MIT-style
5+
// license that can be found in the LICENSE file.
6+
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler
7+
8+
package graceful
9+
10+
// This file contains shims for windows builds
11+
const IsChild = false

modules/graceful/net.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
// Copyright 2019 The Gitea Authors. All rights reserved.
24
// Use of this source code is governed by a MIT-style
35
// license that can be found in the LICENSE file.

modules/graceful/restart.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
// Copyright 2019 The Gitea Authors. All rights reserved.
24
// Use of this source code is governed by a MIT-style
35
// license that can be found in the LICENSE file.

modules/graceful/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
// Copyright 2019 The Gitea Authors. All rights reserved.
24
// Use of this source code is governed by a MIT-style
35
// license that can be found in the LICENSE file.

modules/graceful/server_hooks.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
// Copyright 2019 The Gitea Authors. All rights reserved.
24
// Use of this source code is governed by a MIT-style
35
// license that can be found in the LICENSE file.

modules/graceful/server_http.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
// Copyright 2019 The Gitea Authors. All rights reserved.
24
// Use of this source code is governed by a MIT-style
35
// license that can be found in the LICENSE file.

modules/graceful/server_signals.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build !windows
2+
13
// Copyright 2019 The Gitea Authors. All rights reserved.
24
// Use of this source code is governed by a MIT-style
35
// license that can be found in the LICENSE file.

0 commit comments

Comments
 (0)