Skip to content

Commit

Permalink
Merge pull request #1 from sudomopoy/master
Browse files Browse the repository at this point in the history
fix: client package issue
  • Loading branch information
sudomopoy authored Feb 8, 2025
2 parents ab4c14b + 34d242b commit 7c058ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 0 additions & 15 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"context"
"log"
"time"

pb "github.com/sudomopoy/flush-ticker/gen/go/tick/v1"
Expand Down Expand Up @@ -35,17 +34,3 @@ func (c *GrpcClient) Tick() (*pb.TickResponse, error) {
func (c *GrpcClient) Close() error {
return c.conn.Close()
}

func main() {
client, err := NewTickClient("localhost:8080")
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
defer client.Close()

resp, err := client.Tick()
if err != nil {
log.Fatalf("failed to call Tick: %v", err)
}
log.Printf("Tick response: %v", resp)
}
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ func main() {

ticker := time.NewTicker(1 * time.Minute)
defer ticker.Stop()
tickClient := NewTickClient(*serviceURL)
tickClient, err := NewTickClient(*serviceURL)
if err != nil {
fmt.Println(err)
}
for {
select {
case <-ticker.C:
Expand Down

0 comments on commit 7c058ae

Please sign in to comment.