Refactor database environment variable usage across workflows and application code
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 3m53s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 3m53s
- Updated Gitea workflows to standardize on `DB_NAME` instead of `DB_DATABASE` for database name references. - Modified deployment, backup, reset, and restore workflows to ensure consistent environment variable usage. - Removed dotenv dependency and preload script, transitioning to environment variable management directly in scripts. - Adjusted application code to utilize `DB_NAME` for database connections and logging. - Enhanced README to reflect changes in environment variable configuration and usage. - Cleaned up package.json scripts to remove unnecessary preload references.
This commit is contained in:
@@ -12,7 +12,7 @@ import * as emailService from './emailService.server';
|
||||
import * as db from './db/index.db';
|
||||
import { generateFlyerIcon } from '../utils/imageProcessor';
|
||||
|
||||
export const connection = new IORedis(process.env.REDIS_URL || 'redis://127.0.0.1:6379', {
|
||||
export const connection = new IORedis(process.env.REDIS_URL!, {
|
||||
maxRetriesPerRequest: null, // Important for BullMQ
|
||||
password: process.env.REDIS_PASSWORD, // Add the password from environment variables
|
||||
});
|
||||
@@ -224,7 +224,7 @@ export const flyerWorker = new Worker<FlyerJobData>(
|
||||
// Control the number of concurrent jobs. This directly limits parallel calls to the AI API.
|
||||
// It's sourced from an environment variable for easy configuration without code changes.
|
||||
// The Google AI free tier limit is 60 RPM, so a low concurrency is safe.
|
||||
concurrency: parseInt(process.env.WORKER_CONCURRENCY || '5', 10),
|
||||
concurrency: parseInt(process.env.WORKER_CONCURRENCY!, 10),
|
||||
}
|
||||
);
|
||||
|
||||
@@ -307,7 +307,7 @@ export const cleanupWorker = new Worker<CleanupJobData>(
|
||||
}
|
||||
|
||||
// 2. Determine the base path for the flyer images.
|
||||
const storagePath = process.env.STORAGE_PATH || '/var/www/flyer-crawler.projectium.com/flyer-images';
|
||||
const storagePath = process.env.STORAGE_PATH!;
|
||||
|
||||
// 3. Delete the main flyer image.
|
||||
const mainImagePath = path.join(storagePath, path.basename(flyer.image_url));
|
||||
|
||||
Reference in New Issue
Block a user