Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recently active is active within past 10 minutes
changes query of recently active from: ```sql -- MiqServer.where(:last_heartbeat => 10.minutes.ago.utc...Time.now.utc).first SELECT "miq_servers".* FROM "miq_servers" WHERE "miq_servers"."last_heartbeat" >= $1 AND "miq_servers"."last_heartbeat" < $2 ORDER BY "miq_servers"."id" ASC LIMIT $3 ``` to ```sql -- MiqServer.where(:last_heartbeat => 10.minutes.ago.utc..).first SELECT "miq_servers".* FROM "miq_servers" WHERE "miq_servers"."last_heartbeat" >= $1 ORDER BY "miq_servers"."id" ASC LIMIT $2 ``` Implications ============ This makes development environments (rails s) easier since we can set the heartbeat in the future. This is necessary to run workflows with rails console / simulate_queue_worker because ```ruby MiqServer.last.update(:last_heartbeat => 1.day.from_now.utc) before: MiqServer.where(:last_heartbeat => 10.minutes.ago.utc...Time.now.utc).exist? => false MiqRegion.my_region.remote_ws_url => nil after: MiqServer.where(:last_heartbeat => 10.minutes.ago.utc..).exist? => true MiqRegion.my_region.remote_ws_url => http://localhost:4000/ ```
- Loading branch information