Browse Source

fix(spec): remove local feed testing server

Ryotaro Nagahara 1 month ago
parent
commit
47fa9f1f1a

+ 3 - 0
.gitignore

@@ -1,5 +1,8 @@
 # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
 
+# Local development tools (not for production)
+/dev-local/
+
 # dependencies
 node_modules
 /.pnp

+ 0 - 17
apps/app/run-news-cron.mts

@@ -1,17 +0,0 @@
-// biome-ignore-all lint/suspicious/noConsole: dev script
-import mongoose from 'mongoose';
-
-import { NewsCronService } from './src/features/news/server/services/news-cron-service.js';
-
-const MONGO_URI = process.env.MONGO_URI ?? 'mongodb://mongo:27017/growi';
-process.env.NEWS_FEED_URL ??= 'http://localhost:8099/feed.json';
-process.env.GROWI_SKIP_NEWS_SLEEP = 'true';
-
-console.log(`Connecting to ${MONGO_URI}...`);
-await mongoose.connect(MONGO_URI);
-console.log('Connected. Running cron job...');
-
-await new NewsCronService().executeJob();
-
-console.log('Done.');
-await mongoose.disconnect();

+ 1 - 4
apps/app/src/features/news/server/services/news-cron-service.ts

@@ -93,10 +93,7 @@ export class NewsCronService extends CronService {
     }
 
     // Random sleep to distribute requests across multiple GROWI instances
-    // Skip in development/testing via GROWI_SKIP_NEWS_SLEEP=true
-    if (process.env.GROWI_SKIP_NEWS_SLEEP !== 'true') {
-      await randomSleep(MAX_RANDOM_SLEEP_MS);
-    }
+    await randomSleep(MAX_RANDOM_SLEEP_MS);
 
     let feedJson: FeedJson;
     try {