[Catalyst] Connect DBIx::Class model on startup?

Daniel J. Luke dluke at geeklair.net
Tue Feb 21 18:30:32 GMT 2012


Is there a canonical (or recommended) way to have my new fastcgi processes' model(s) connect to their databases on startup (instead of during the first request?)

I'd like to be able to avoid the extra delay on the first request each fastcgi process has while it's connecting to the DB. I think it probably belongs in my Catalyst::Model::DBIC::Schema class (maybe after BUILD ?)

Or maybe there's a reason why there's not an obvious hook and someone can point me to the pitfalls I'm not seeing.

Thanks.
--
Daniel J. Luke                                                                   
+========================================================+                        
| *---------------- dluke at geeklair.net ----------------* |                          
| *-------------- http://www.geeklair.net -------------* |                          
+========================================================+                        
|   Opinions expressed are mine and do not necessarily   |                          
|          reflect the opinions of my employer.          |                          
+========================================================+






More information about the Catalyst mailing list