Skip to content

Commit

Permalink
update task logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
qingshu-ui committed Sep 26, 2024
1 parent 15f6a6c commit dba692e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class RandomVideo(

@Scheduled(cron = "0 0/15 * * * ?")
fun updateVideoInfo() {
if (service.allUnUpdatedCount() == 0) return
log.info("开始更新视频信息")
val baseConfig = EAConfig.base
val botSession = sessionFactory.createSession("localhost")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ interface DouYinVideoRepository : JpaRepository<DouYinVideoEntity, Int> {

fun findByUsedTodayIsTrue(): List<DouYinVideoEntity>

@Query(
value = "select v from DouYinVideoEntity v " +
"where v.updateStatus = :status order by function('random') "
)
fun findByUpdateStatus(status: String, pageable: Pageable): List<DouYinVideoEntity>

fun countByUpdateStatus(status: String = "pending"): Int
Expand Down

0 comments on commit dba692e

Please sign in to comment.