some more tweaks and fixes
This commit is contained in:
7
main.go
7
main.go
@@ -76,8 +76,9 @@ login:
|
||||
}
|
||||
|
||||
func main() {
|
||||
os.MkdirAll("/opt/tmp", os.ModeDir)
|
||||
SetupCloseHandler()
|
||||
if viper.GetBool("no_run_on_start") {
|
||||
if !viper.GetBool("no_run_on_start") {
|
||||
go cronTask()
|
||||
}
|
||||
|
||||
@@ -155,13 +156,13 @@ func cronTask() error {
|
||||
var fbPostErr error
|
||||
postID, fbPost, fbPostErr = page8(taskCtx)
|
||||
fmt.Printf("Error: %#v\n", fbPostErr)
|
||||
if fbPost.TimeStamp != lastUpdatePosted {
|
||||
if fbPost != nil && fbPost.TimeStamp != lastUpdatePosted {
|
||||
page9(taskCtx, postID)
|
||||
}
|
||||
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
if fbPost.TimeStamp != lastUpdatePosted {
|
||||
if fbPost != nil && fbPost.TimeStamp != lastUpdatePosted {
|
||||
timeStamp := fbPost.TimeStamp
|
||||
pTime, err := time.Parse(time.RFC3339, fbPost.TimeStamp)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user