Increase post fetch interval and add initial fetch on startup
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
*.db
|
||||
*.sqlite
|
||||
build/
|
@@ -15,7 +15,7 @@ func main() {
|
||||
// Setup AppContext
|
||||
var appContext = helpers.SetupAppContext()
|
||||
|
||||
ticker := time.NewTicker(1 * time.Minute)
|
||||
ticker := time.NewTicker(10 * time.Minute)
|
||||
|
||||
runFetchPosts := func() {
|
||||
// Get posts
|
||||
@@ -50,6 +50,10 @@ func main() {
|
||||
runFetchPosts()
|
||||
}
|
||||
}()
|
||||
// Run initial fetch on startup
|
||||
go func() {
|
||||
runFetchPosts()
|
||||
}()
|
||||
|
||||
// https://seefnasrul.medium.com/create-your-first-go-rest-api-with-jwt-authentication-in-gin-framework-dbe5bda72817
|
||||
engine := gin.Default()
|
||||
|
Reference in New Issue
Block a user