Browse Source

added numprocs

tags/v1.0.0
Remco 8 years ago
parent
commit
8ed9a5d5ca
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      transfersh-server/main.go

+ 8
- 2
transfersh-server/main.go View File

@@ -29,15 +29,17 @@ import (
// _ "transfer.sh/app/utils" // _ "transfer.sh/app/utils"
"flag" "flag"
"fmt" "fmt"
"github.com/PuerkitoBio/ghost/handlers"
"github.com/gorilla/mux"
"log" "log"
"math/rand" "math/rand"
"mime" "mime"
"net/http" "net/http"
"net/url" "net/url"
"os" "os"
"runtime"
"time" "time"

"github.com/PuerkitoBio/ghost/handlers"
"github.com/gorilla/mux"
) )


const SERVER_INFO = "transfer.sh" const SERVER_INFO = "transfer.sh"
@@ -73,6 +75,10 @@ func init() {
func main() { func main() {
rand.Seed(time.Now().UTC().UnixNano()) rand.Seed(time.Now().UTC().UnixNano())


nCPU := runtime.NumCPU()
runtime.GOMAXPROCS(nCPU)
fmt.Println("Number of CPUs: ", nCPU)

r := mux.NewRouter() r := mux.NewRouter()


r.PathPrefix("/scripts/").Methods("GET").Handler(http.FileServer(http.Dir("./static/"))) r.PathPrefix("/scripts/").Methods("GET").Handler(http.FileServer(http.Dir("./static/")))


Loading…
Cancel
Save