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