add debugging logs for seeding script
This commit is contained in:
@@ -52,12 +52,16 @@ func saveTasks(db *pgxpool.Pool, ctx context.Context, tasks []models.Task) error
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
fmt.Println("Starting seed process")
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
db, err := pgxpool.New(ctx, config.Db.Url)
|
db, err := pgxpool.New(ctx, config.Db.Url)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Unable to create connection pool: %v", err)
|
log.Fatalf("Unable to create connection pool: %v", err)
|
||||||
|
} else {
|
||||||
|
fmt.Println("Successfully connected to the database")
|
||||||
}
|
}
|
||||||
defer db.Close()
|
defer db.Close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user