mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
don't run if we are already running, closes #31
This commit is contained in:
parent
3cfef30d02
commit
ec72568733
1 changed files with 9 additions and 0 deletions
|
@ -232,6 +232,15 @@ module Sinatra
|
|||
|
||||
# Contains the methods defined in Sinatra::Base that are overriden.
|
||||
module BaseMethods
|
||||
# Protects Sinatra::Base.run! from being called more than once.
|
||||
def run!(*args)
|
||||
if settings.reloader?
|
||||
super unless running?
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
# Does everything Sinatra::Base#route does, but it also tells the
|
||||
# +Watcher::List+ for the Sinatra application to watch the defined
|
||||
# route.
|
||||
|
|
Loading…
Reference in a new issue