pid

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCurrentPidAndStartTime

func DeleteCurrentPidAndStartTime(path string) error

DeleteCurrentPidAndStartTime delete the file created by SaveCurrentPidAndStartTime

func GetProcessStartTime

func GetProcessStartTime(pid int) (string, error)

GetProcessStartTime returns the start time of the active process if still active

func IsExtensionStillRunning

func IsExtensionStillRunning(path string) bool

IsExtensionStillRunning checks if there is active process for the same extension name

func KillPreviousExtension

func KillPreviousExtension(ctx *log.Context, pidFilePath string)

KillPreviousExtension handles the case where a process for the same extension name is still active from previous execution. We need to kill it before staring a new one.

func ReadPidAndStartTime

func ReadPidAndStartTime(path string) (int, string, error)

ReadPidAndStartTime reads the stored pid and process start time from a file extName.pid Returns 0 and "" if path not found

func SaveCurrentPidAndStartTime

func SaveCurrentPidAndStartTime(path string) error

SaveCurrentPidAndStartTime stores current process id with start date in file extName.pid Example: 325 Tue Dec 8 15:54:04 2020

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL