Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete archive if stream is ended but Twitch API is slow to update #385

Merged
merged 9 commits into from
Mar 31, 2024
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR /tmp

RUN wget https://github.com/rsms/inter/releases/download/v4.0-beta7/Inter-4.0-beta7.zip && unzip Inter-4.0-beta7.zip && mkdir -p /usr/share/fonts/opentype/inter/ && cp /tmp/Desktop/Inter-*.otf /usr/share/fonts/opentype/inter/ && fc-cache -f -v

RUN wget https://github.com/lay295/TwitchDownloader/releases/download/1.54.0/TwitchDownloaderCLI-1.54.0-Linux-x64.zip && unzip TwitchDownloaderCLI-1.54.0-Linux-x64.zip && mv TwitchDownloaderCLI /usr/local/bin/ && chmod +x /usr/local/bin/TwitchDownloaderCLI && rm TwitchDownloaderCLI-1.54.0-Linux-x64.zip
RUN wget https://github.com/lay295/TwitchDownloader/releases/download/1.54.1/TwitchDownloaderCLI-1.54.1-Linux-x64.zip && unzip TwitchDownloaderCLI-1.54.1-Linux-x64.zip && mv TwitchDownloaderCLI /usr/local/bin/ && chmod +x /usr/local/bin/TwitchDownloaderCLI && rm TwitchDownloaderCLI-1.54.1-Linux-x64.zip

#RUN wget https://github.com/xenova/chat-downloader/archive/refs/tags/v${CHAT_DOWNLOADER_VER}.tar.gz
#RUN tar -xvf v${CHAT_DOWNLOADER_VER}.tar.gz && cd chat-downloader-${CHAT_DOWNLOADER_VER} && python3 setup.py install && cd .. && rm -f v${CHAT_DOWNLOADER_VER}.tar.gz && rm -rf chat-downloader-${CHAT_DOWNLOADER_VER}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ go.work
dev
tmp
**/__debug
__debug*
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ FROM debian:bookworm-slim AS build-stage-02
RUN apt update && apt install -y git wget unzip

WORKDIR /tmp
RUN wget https://github.com/lay295/TwitchDownloader/releases/download/1.54.0/TwitchDownloaderCLI-1.54.0-Linux-x64.zip && unzip TwitchDownloaderCLI-1.54.0-Linux-x64.zip
RUN wget https://github.com/lay295/TwitchDownloader/releases/download/1.54.1/TwitchDownloaderCLI-1.54.1-Linux-x64.zip && unzip TwitchDownloaderCLI-1.54.1-Linux-x64.zip

RUN git clone https://github.com/xenova/chat-downloader.git

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN apt-get install unzip wget git -y

WORKDIR /tmp
RUN wget https://github.com/rsms/inter/releases/download/v3.19/Inter-3.19.zip && unzip Inter-3.19.zip
RUN wget https://github.com/lay295/TwitchDownloader/releases/download/1.54.0/TwitchDownloaderCLI-1.54.0-LinuxArm.zip && unzip TwitchDownloaderCLI-1.54.0-LinuxArm.zip
RUN wget https://github.com/lay295/TwitchDownloader/releases/download/1.54.1/TwitchDownloaderCLI-1.54.1-LinuxArm.zip && unzip TwitchDownloaderCLI-1.54.1-LinuxArm.zip

RUN git clone https://github.com/xenova/chat-downloader.git

Expand Down
5 changes: 0 additions & 5 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ func Run() error {
zerolog.SetGlobalLevel(zerolog.InfoLevel)
}

//store, err := database.NewDatabase()
//if err != nil {
// log.Error().Err(err).Msg("failed to create database connection")
// return err
//}
database.InitializeDatabase(false)
store := database.DB()

Expand Down
6 changes: 5 additions & 1 deletion cmd/worker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/zibbp/ganymede/internal/activities"
serverConfig "github.com/zibbp/ganymede/internal/config"
"github.com/zibbp/ganymede/internal/database"
"github.com/zibbp/ganymede/internal/temporal"
"github.com/zibbp/ganymede/internal/twitch"
"github.com/zibbp/ganymede/internal/workflows"

Expand Down Expand Up @@ -108,7 +109,7 @@ func main() {
// this needs to be removed in the future to decouple the worker from the server
serverConfig.NewConfig(false)

logger := zerolog.New(os.Stdout).With().Timestamp().Logger()
logger := zerolog.New(os.Stdout).With().Timestamp().Logger().With().Str("service", "worker").Logger()

clientOptions := client.Options{
HostPort: config.TEMPORAL_URL,
Expand All @@ -129,6 +130,9 @@ func main() {

database.InitializeDatabase(true)

// Initialize the temporal client for the worker
temporal.InitializeTemporalClient()

taskQueues := map[string]int{
"archive": 100,
"chat-download": config.MAX_CHAT_DOWNLOAD_EXECUTIONS,
Expand Down
48 changes: 48 additions & 0 deletions ent/channel_update.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions ent/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions ent/live.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions ent/live/live.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions ent/live/where.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading