Skip to content

Commit 98a5492

Browse files
Refactor queue and worker packages: remove unused code and implement new task structure
1 parent f47c8c5 commit 98a5492

19 files changed

Lines changed: 52 additions & 283 deletions

File tree

cmd/.gitkeep

Whitespace-only changes.

cmd/producer/main.go

Lines changed: 0 additions & 47 deletions
This file was deleted.

cmd/worker/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ import (
1010
func main() {
1111
cfg := config.Load()
1212

13-
client := queue.NewRedisClient(cfg)
13+
client := queue.NewClient(cfg)
1414
defer client.Close()
1515

1616
if err := queue.Ping(client); err != nil {
1717
log.Fatal("Redis connection failed:", err)
1818
}
1919

20-
log.Println("Worker started")
2120
log.Println("Connected to Redis")
22-
23-
queue.ConsumeJobs(client)
21+
log.Println("Worker started")
2422
}

go.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,11 @@ require (
2929
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.36.6 // indirect
3030
github.com/aws/aws-sdk-go-v2/service/sts v1.43.3 // indirect
3131
github.com/aws/smithy-go v1.27.1 // indirect
32+
github.com/google/uuid v1.6.0 // indirect
33+
github.com/hibiken/asynq v0.26.0 // indirect
34+
github.com/robfig/cron/v3 v3.0.1 // indirect
35+
github.com/spf13/cast v1.10.0 // indirect
36+
golang.org/x/sys v0.37.0 // indirect
37+
golang.org/x/time v0.14.0 // indirect
38+
google.golang.org/protobuf v1.36.10 // indirect
3239
)

go.sum

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,23 @@ github.com/aws/smithy-go v1.27.1 h1:4T340VFndXtADGF52gYa1POyL7s9E4Z1OeZ1hCscIw8=
3636
github.com/aws/smithy-go v1.27.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
3737
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
3838
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
39+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
40+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
41+
github.com/hibiken/asynq v0.26.0 h1:1Zxr92MlDnb1Zt/QR5g2vSCqUS03i95lUfqx5X7/wrw=
42+
github.com/hibiken/asynq v0.26.0/go.mod h1:Qk4e57bTnWDoyJ67VkchuV6VzSM9IQW2nPvAGuDyw58=
3943
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
4044
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
4145
github.com/redis/go-redis/v9 v9.20.1 h1:sfCU6A8P3dXbKyWes02uxA2baehGux9dZHfEKtsTB1w=
4246
github.com/redis/go-redis/v9 v9.20.1/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA=
47+
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
48+
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
49+
github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY=
50+
github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo=
4351
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
4452
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
53+
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
54+
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
55+
golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI=
56+
golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4=
57+
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
58+
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=

internal/.gitkeep

Whitespace-only changes.

internal/processor/processor.go

Lines changed: 0 additions & 20 deletions
This file was deleted.

internal/processor/workspace.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

internal/queue/constants.go

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/queue/consumer.go

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)