check-queue.ts 1.1 KB

123456789101112131415161718
  1. const { prisma } = require('../src/models');
  2. async function check() {
  3. const tasks = await prisma.ttsTask.findMany({ orderBy: { id: 'asc' } });
  4. console.log('=== TtsTask 队列表 ===');
  5. tasks.forEach(t => console.log(' #'+t.id, 'type='+t.taskType, 'status='+t.status, 'ch='+t.chapterId, 'hash='+t.contentHash?.substring(0,10), 'retry='+t.retryCount));
  6. console.log(' 总计:', tasks.length, '个任务\n');
  7. const book = await prisma.book.findUnique({ where: { id: 30 }, select: { genStage: true, progress: true } });
  8. console.log('=== 书籍 #30 === genStage:', book?.genStage, 'progress:', book?.progress, '\n');
  9. const chapters = await prisma.bookChapter.findMany({ where: { bookId: 30 }, orderBy: { id: 'asc' }, select: { id: true, level: true, number: true, title: true, genStage: true, wordCount: true, audioUrl: true } });
  10. console.log('=== 章节状态 ===');
  11. chapters.forEach(c => console.log(' #'+c.id, 'L'+c.level, '#'+c.number, (c.title||'').substring(0,25), c.genStage, c.wordCount+'字', c.audioUrl ? '有音频' : '无音频'));
  12. await prisma.$disconnect();
  13. }
  14. check().catch(e => { console.error(e); process.exit(1); });