mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-30 09:57:51 +01:00
Add nginx exec
This commit is contained in:
1 parent
b8008606fd
commit
5b6dbaf43e
6 files changed
+101
-14
No files matched your search
@@ -11,7 +11,7 @@ var (
|
||||
worker *Worker
|
||||
)
|
||||
|
||||
// Start ...
|
||||
// Start will intantiate the queue and start doing work
|
||||
func Start() {
|
||||
ctx, cancel = context.WithCancel(context.Background())
|
||||
q := &Queue{
|
||||
@@ -27,6 +27,15 @@ func Start() {
|
||||
go worker.doWork()
|
||||
}
|
||||
|
||||
// Shutdown will gracefully stop the queue
|
||||
func Shutdown() error {
|
||||
if cancel == nil {
|
||||
return errors.New("Unable to shutdown, jobqueue has not been started")
|
||||
}
|
||||
cancel()
|
||||
return nil
|
||||
}
|
||||
|
||||
// AddJob adds a job to the queue for processing
|
||||
func AddJob(j Job) error {
|
||||
if worker == nil {
|
||||
@@ -35,12 +44,3 @@ func AddJob(j Job) error {
|
||||
worker.Queue.AddJob(j)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Shutdown ...
|
||||
func Shutdown() error {
|
||||
if cancel == nil {
|
||||
return errors.New("Unable to shutdown, jobqueue has not been started")
|
||||
}
|
||||
cancel()
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user