CLI flush action
This commit is contained in:
+13
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
@@ -89,6 +90,18 @@ func main() {
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "flush",
|
||||
Usage: "Flush all messages from given queues",
|
||||
Action: func(c *cli.Context) {
|
||||
if msgs := bsq.Flush(c.Args()...); msgs != nil {
|
||||
jsn, _ := json.Marshal(msgs)
|
||||
fmt.Println(string(jsn))
|
||||
} else {
|
||||
fmt.Printf("Failed to flush queues %s\n", strings.Join(c.Args(), ", "))
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "status",
|
||||
Usage: "Show server status",
|
||||
|
||||
Reference in New Issue
Block a user