Detect if Cron is Running

Yes, wp_doing_cron will return true if the current request is a WP Cron request, or if it’s triggered from WP CLI

https://developer.wordpress.org/reference/functions/wp_doing_cron/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)