add config
This commit is contained in:
13
pkg/utils/exit.go
Normal file
13
pkg/utils/exit.go
Normal file
@ -0,0 +1,13 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Exit(err error) {
|
||||
log.Println(err)
|
||||
time.Sleep(time.Second * 2)
|
||||
os.Exit(1)
|
||||
}
|
@ -11,14 +11,14 @@ import (
|
||||
)
|
||||
|
||||
func Hack() {
|
||||
cfg, _ := settings.GetConfig()
|
||||
cfg, _ := settings.GetConfig("settings")
|
||||
tp := jira.BasicAuthTransport{
|
||||
Username: cfg.Jira.Auth.Username,
|
||||
Password: cfg.Jira.Auth.Password,
|
||||
}
|
||||
|
||||
jiraClient, _ := jira.NewClient(tp.Client(), cfg.Jira.Url)
|
||||
|
||||
|
||||
me, _, _ := jiraClient.User.GetSelf()
|
||||
|
||||
timeNeed := 165 // Количество часов
|
||||
|
@ -15,3 +15,5 @@ func GetProducer() *nsq.Producer {
|
||||
}
|
||||
return producer
|
||||
}
|
||||
|
||||
func GetConsumer()
|
16
pkg/utils/wait.go
Normal file
16
pkg/utils/wait.go
Normal file
@ -0,0 +1,16 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func Wait() {
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
select {
|
||||
case <-c:
|
||||
return
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user