mirror of
				https://gitea.invidious.io/iv-org/shard-kemal.git
				synced 2024-08-15 00:53:36 +00:00 
			
		
		
		
	Don't initiliaze server if it's already initialized
This commit is contained in:
		
							parent
							
								
									ad692357d4
								
							
						
					
					
						commit
						0b07070237
					
				
					 2 changed files with 3 additions and 4 deletions
				
			
		|  | @ -164,5 +164,4 @@ describe "Kemal::RouteHandler" do | |||
|     client_response.status_code.should eq(302) | ||||
|     client_response.headers.has_key?("Location").should eq(true) | ||||
|   end | ||||
|    | ||||
| end | ||||
|  |  | |||
|  | @ -13,6 +13,7 @@ module Kemal | |||
|       log "[#{config.env}] Kemal is ready to lead at #{config.scheme}://#{config.host_binding}:#{config.port}" | ||||
|     end | ||||
|   end | ||||
| 
 | ||||
|   # Overload of self.run without port - fixex #399 | ||||
|   def self.run | ||||
|     self.run(nil) | ||||
|  | @ -58,11 +59,10 @@ module Kemal | |||
|       end | ||||
|     end | ||||
| 
 | ||||
|     server = HTTP::Server.new(config.host_binding, config.port, config.handlers) | ||||
|     config.server ||= HTTP::Server.new(config.host_binding, config.port, config.handlers) | ||||
|     {% if !flag?(:without_openssl) %} | ||||
|     server.tls = config.ssl | ||||
|     config.server.not_nil!.tls = config.ssl | ||||
|     {% end %} | ||||
|     config.server ||= server | ||||
|     config.running = true | ||||
| 
 | ||||
|     yield config | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue