Old LazyYT cooked posts have not been rebaked after lazy-yt was replaced with lazy-video

I did not delve into why my posts were not rebaked so it remains a mystery. If somebody encounters this problem and wants to rebake manually their posts this is how i did go about it:

Enter Rails console:

cd /var/discourse
./launcher enter app
rails c

And I did run this script:

posts = Post.where ("cooked like '%lazyYT%'")
posts.each do |p|
    p.rebake!     
    sleep 1 
end

One post per second is slower than I would like, but I wanted to be extra sure that I will not hit any YouTube limits if there are any. For 12 000 posts it was not that bad of a wait.

2 Likes