fix(autogen): hoist currentHour/currentMinute to function scope — ReferenceError ломал крон-ветку ротации, статьи не генерились
This commit is contained in:
@@ -179,6 +179,7 @@ async function runAutogenForCategory(category) {
|
||||
*/
|
||||
async function runAutogen({ forceCategory = null } = {}) {
|
||||
let whereClause, params = [];
|
||||
let currentHour, currentMinute;
|
||||
|
||||
if (forceCategory) {
|
||||
// Ручной запуск — игнорируем время
|
||||
@@ -190,8 +191,8 @@ async function runAutogen({ forceCategory = null } = {}) {
|
||||
const now = new Date();
|
||||
const mskOffset = 3 * 60; // UTC+3
|
||||
const mskTime = new Date(now.getTime() + mskOffset * 60000);
|
||||
const currentHour = mskTime.getUTCHours();
|
||||
const currentMinute = mskTime.getUTCMinutes();
|
||||
currentHour = mskTime.getUTCHours();
|
||||
currentMinute = mskTime.getUTCMinutes();
|
||||
|
||||
console.log(`[Autogen] Check time MSK ${String(currentHour).padStart(2,'0')}:${String(currentMinute).padStart(2,'0')}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user