Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
outerwinnie committed Sep 5, 2024
1 parent 3a40452 commit 3d3f2f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ ENV DISCORD_BOT_TOKEN=""
ENV DISCORD_CHANNEL_ID=""
ENV GOOGLE_DRIVE_FILE_ID=""
ENV GOOGLE_CREDENTIALS_PATH="/app/credentials.json"
ENV CSV_FILE_PATH="/app/data/rewards.csv"
ENV POST_TIME="20:00:00"

# Entry point for the application
Expand Down
13 changes: 9 additions & 4 deletions Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Globalization;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Discord;
using Discord.WebSocket;
Expand Down Expand Up @@ -77,8 +76,14 @@ private static async Task MonitorCsvFileAsync()
{
try
{
// Path to your rewards.csv file
string csvFilePath = "rewards.csv";
// Read CSV file path from Docker environment variable
string csvFilePath = Environment.GetEnvironmentVariable("CSV_FILE_PATH");

if (string.IsNullOrEmpty(csvFilePath))
{
Console.WriteLine("CSV_FILE_PATH environment variable is not set.");
return;
}

if (File.Exists(csvFilePath))
{
Expand All @@ -105,7 +110,7 @@ private static async Task MonitorCsvFileAsync()
}
else
{
Console.WriteLine("CSV file not found.");
Console.WriteLine($"CSV file not found at path: {csvFilePath}");
}
}
catch (Exception ex)
Expand Down

0 comments on commit 3d3f2f0

Please sign in to comment.