Removed time.Sleep statements in jobs
This commit is contained in:
parent
bd6291290b
commit
21823890e0
@ -4,7 +4,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
|
||||||
|
|
||||||
_ "image/gif"
|
_ "image/gif"
|
||||||
_ "image/jpeg"
|
_ "image/jpeg"
|
||||||
@ -33,8 +32,6 @@ func main() {
|
|||||||
fmt.Printf("[%d / %d] %s %s\n", index+1, len(characters), character.ID, color.CyanString(character.String()))
|
fmt.Printf("[%d / %d] %s %s\n", index+1, len(characters), character.ID, color.CyanString(character.String()))
|
||||||
download(character.ID)
|
download(character.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func download(characterID string) {
|
func download(characterID string) {
|
||||||
|
@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
@ -32,8 +31,5 @@ func main() {
|
|||||||
|
|
||||||
// Save the file information
|
// Save the file information
|
||||||
track.Save()
|
track.Save()
|
||||||
|
|
||||||
// Delay a little
|
|
||||||
time.Sleep(delayBetweenRequests)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,6 +40,4 @@ func main() {
|
|||||||
|
|
||||||
character.Save()
|
character.Save()
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
@ -55,5 +54,4 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(len(used), len(characters))
|
fmt.Println(len(used), len(characters))
|
||||||
time.Sleep(2 * time.Second)
|
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
@ -40,6 +39,4 @@ func main() {
|
|||||||
animeList.Save()
|
animeList.Save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(time.Second)
|
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,5 @@ func main() {
|
|||||||
// newID := arn.GenerateID("Anime")
|
// newID := arn.GenerateID("Anime")
|
||||||
// fmt.Printf("[%d / %d] Old [%s] New [%s] %s\n", counter+1, len(allAnime), color.YellowString(anime.ID), color.GreenString(newID), anime)
|
// fmt.Printf("[%d / %d] Old [%s] New [%s] %s\n", counter+1, len(allAnime), color.YellowString(anime.ID), color.GreenString(newID), anime)
|
||||||
// anime.SetID(newID)
|
// anime.SetID(newID)
|
||||||
// time.Sleep(100 * time.Millisecond)
|
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,4 @@ func main() {
|
|||||||
anime.Save()
|
anime.Save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
@ -41,6 +40,4 @@ func main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(1 * time.Second)
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@ import (
|
|||||||
"image"
|
"image"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/animenotifier/arn"
|
"github.com/animenotifier/arn"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
@ -20,7 +19,6 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
defer color.Green("Finished.")
|
defer color.Green("Finished.")
|
||||||
defer arn.Node.Close()
|
defer arn.Node.Close()
|
||||||
defer time.Sleep(time.Second)
|
|
||||||
|
|
||||||
characters := arn.FilterCharacters(func(character *arn.Character) bool {
|
characters := arn.FilterCharacters(func(character *arn.Character) bool {
|
||||||
return character.HasImage()
|
return character.HasImage()
|
||||||
|
49
patches/user-set-social-id/user-set-social-id.go
Normal file
49
patches/user-set-social-id/user-set-social-id.go
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
|
||||||
|
"github.com/animenotifier/arn"
|
||||||
|
"github.com/fatih/color"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Shell parameters
|
||||||
|
var nick string
|
||||||
|
var service string
|
||||||
|
var serviceID string
|
||||||
|
|
||||||
|
// Shell flags
|
||||||
|
func init() {
|
||||||
|
flag.StringVar(&nick, "nick", "", "Nick of the user")
|
||||||
|
flag.StringVar(&service, "service", "", "Service name (Google or Facebook)")
|
||||||
|
flag.StringVar(&serviceID, "serviceID", "", "ID of the user on the given service")
|
||||||
|
flag.Parse()
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
if nick == "" || service == "" || serviceID == "" {
|
||||||
|
flag.Usage()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
color.Yellow("Updating user service ID")
|
||||||
|
|
||||||
|
defer color.Green("Finished.")
|
||||||
|
defer arn.Node.Close()
|
||||||
|
|
||||||
|
user, err := arn.GetUserByNick(nick)
|
||||||
|
arn.PanicOnError(err)
|
||||||
|
|
||||||
|
switch service {
|
||||||
|
case "Google":
|
||||||
|
user.ConnectGoogle(serviceID)
|
||||||
|
|
||||||
|
case "Facebook":
|
||||||
|
user.ConnectFacebook(serviceID)
|
||||||
|
|
||||||
|
default:
|
||||||
|
panic("Unknown service")
|
||||||
|
}
|
||||||
|
|
||||||
|
user.Save()
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user