update
This commit is contained in:
+5
-3
@@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -22,7 +21,6 @@ type JsReply string
|
|||||||
var o = NewBucket("otto")
|
var o = NewBucket("otto")
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
{
|
{
|
||||||
@@ -45,7 +43,11 @@ var OttoFuncs = map[string]func(string) string{
|
|||||||
// }
|
// }
|
||||||
id, err := machineid.ProtectedID("sillyGirl")
|
id, err := machineid.ProtectedID("sillyGirl")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
id = sillyGirl.Get("machineId")
|
||||||
|
if id == "" {
|
||||||
|
id = GetUUID()
|
||||||
|
sillyGirl.Set("machineId", id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return id
|
return id
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user