mirror of
https://github.com/Xevion/todoist-late-reset.git
synced 2025-12-09 10:09:00 -06:00
rename, useResources(), simple test
This commit is contained in:
@@ -1,9 +1,10 @@
|
|||||||
package develop
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"internal/api"
|
"internal/api"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
)
|
)
|
||||||
@@ -29,14 +30,21 @@ func main() {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
client = api.NewSyncClient(os.Getenv("TODOIST_API_KEY"))
|
client = api.NewSyncClient(os.Getenv("TODOIST_API_KEY"))
|
||||||
client.Synchronize(true)
|
client.UseResources(api.Items)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
changes, err := client.Synchronize(false)
|
_, err := client.Synchronize(false)
|
||||||
|
|
||||||
|
fmt.Printf("Items: %d\n", len(client.State.Items))
|
||||||
|
for _, item := range client.State.Items {
|
||||||
|
fmt.Println(item)
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Error syncing:", err)
|
fmt.Println("Error syncing:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(30 * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user