Skip to content

Commit

Permalink
Fix multiple issues & add compose example
Browse files Browse the repository at this point in the history
  • Loading branch information
sumboid committed Apr 20, 2024
1 parent 144a3d5 commit 3209377
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
11 changes: 7 additions & 4 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ func RunBot(token string) error {
}

if err := AddReq(reqData); err != nil {
resultsC <- result{
req: req,
err: err,
}
go func() {
resultsC <- result{
req: req,
err: err,
}
}()

return
}
Expand Down Expand Up @@ -176,6 +178,7 @@ func RunBot(token string) error {
})
}
case result := <-resultsC:
L.Debug("Cleaning up the request", zap.Any("request", result.req.Data))
if err := DelReq(result.req.Data); err != nil {
L.Error(
"Failed to clean up request",
Expand Down
17 changes: 17 additions & 0 deletions docker-compose.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:
shortique:
image: ghcr.io/hedlx/shortique:latest
restart: unless-stopped
depends_on:
- redis
environment:
- REDIS=redis:6379
- TOKEN=%TELEGRAM_BOT_TOKEN%
redis:
image: "redis:alpine"
restart: unless-stopped
volumes:
- redis_data:/data

volumes:
redis_data:
4 changes: 3 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ services:
environment:
- REDIS=redis:6379
redis:
image: "redis:6-alpine"
image: "redis:alpine"
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis_data:/data

Expand Down
1 change: 1 addition & 0 deletions download.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func downloadInsta(in DownloadInput, waitC <-chan struct{}, doneC chan<- error)
go func() {
defer resp.Body.Close()
<-waitC
doneC <- nil
}()

return resp.Body
Expand Down

0 comments on commit 3209377

Please sign in to comment.