Addressing review comments.

This commit is contained in:
smruthi2187
2018-02-09 14:26:32 -08:00
parent 841c7ef845
commit 281a492149
18 changed files with 176 additions and 209 deletions
+3 -16
View File
@@ -22,12 +22,10 @@ import (
"fmt"
"net/http"
"os"
"os/signal"
"runtime/debug"
"strconv"
"syscall"
"time"
"github.com/fission/fission"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
_ "github.com/graymeta/stow/local"
@@ -174,20 +172,9 @@ func (ss *StorageService) Start(port int) {
log.Fatal(http.ListenAndServe(address, handlers.LoggingHandler(os.Stdout, r)))
}
func dumpStackTrace() {
debug.PrintStack()
}
func RunStorageService(storageType StorageType, storagePath string, containerName string, port int, enablePruner bool) *StorageService {
// register signal handler for dumping stack trace.
c := make(chan os.Signal, 1)
signal.Notify(c, syscall.SIGTERM)
go func() {
<-c
log.Println("Received SIGTERM : Dumping stack trace")
dumpStackTrace()
os.Exit(1)
}()
// setup a signal handler for SIGTERM
fission.SetupStackTraceHandler()
// initialize logger
log.SetLevel(log.InfoLevel)
-2
View File
@@ -60,7 +60,6 @@ var (
)
func MakeStowClient(storageType StorageType, storagePath string, containerName string) (*StowClient, error) {
log.Infof("start : MakeStowClient")
if storageType != StorageTypeLocal {
return nil, errors.New("Storage types other than 'local' are not implemented")
}
@@ -105,7 +104,6 @@ func MakeStowClient(storageType StorageType, storagePath string, containerName s
}
stowClient.container = con
log.Infof("end : MakeStowClient")
return stowClient, nil
}