Aldino Kemal
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
0 deletions
-
src/cmd/root.go
|
|
@ -17,8 +17,10 @@ import ( |
|
|
"github.com/markbates/pkger" |
|
|
"github.com/markbates/pkger" |
|
|
_ "github.com/mattn/go-sqlite3" |
|
|
_ "github.com/mattn/go-sqlite3" |
|
|
"log" |
|
|
"log" |
|
|
|
|
|
"net/http" |
|
|
"os" |
|
|
"os" |
|
|
"strings" |
|
|
"strings" |
|
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
"github.com/spf13/cobra" |
|
|
"github.com/spf13/cobra" |
|
|
) |
|
|
) |
|
|
@ -108,6 +110,11 @@ func runRest(cmd *cobra.Command, args []string) { |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// Set auto reconnect to whatsapp server after booting
|
|
|
|
|
|
go func() { |
|
|
|
|
|
time.Sleep(2 * time.Second) |
|
|
|
|
|
_, _ = http.Get(fmt.Sprintf("http://localhost:%s/app/reconnect", config.AppPort)) |
|
|
|
|
|
}() |
|
|
err = app.Listen(":" + config.AppPort) |
|
|
err = app.Listen(":" + config.AppPort) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
log.Fatalln("Failed to start: ", err.Error()) |
|
|
log.Fatalln("Failed to start: ", err.Error()) |
|
|
|