mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
procutils: add WaitZombieLoop
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
common_app "yunion.io/x/onecloud/pkg/cloudcommon/app"
|
||||
"yunion.io/x/onecloud/pkg/cloudcommon/db"
|
||||
common_options "yunion.io/x/onecloud/pkg/cloudcommon/options"
|
||||
"yunion.io/x/onecloud/pkg/util/procutils"
|
||||
)
|
||||
|
||||
func StartService() {
|
||||
@@ -49,7 +50,7 @@ func StartService() {
|
||||
db.EnsureAppInitSyncDB(app, dbOpts, models.InitDB)
|
||||
defer cloudcommon.CloseDB()
|
||||
|
||||
go ReapZomebieLoop(context.TODO())
|
||||
go procutils.WaitZombieLoop(context.TODO())
|
||||
|
||||
common_app.ServeForever(app, baseOpts)
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package service
|
||||
package procutils
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -28,7 +28,7 @@ import (
|
||||
"yunion.io/x/log"
|
||||
)
|
||||
|
||||
func ReapZomebieLoop(ctx context.Context) {
|
||||
func WaitZombieLoop(ctx context.Context) {
|
||||
myPid := os.Getpid()
|
||||
if myPid != 1 {
|
||||
log.Infof("My pid is not 1 and no need to wait zombies")
|
||||
Reference in New Issue
Block a user