For the below Sample code, when refreshing the browser around 20 to 30 times, it shows 500 internal server error. It happens because of Server() method. any help on this will be grateful.
Uploaded the screen recording for the same.
python version: 3.8.0
bokeh version: 2.4.1
from bokeh.plotting import figure
from bokeh.models import Range1d
from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
mercator_extent_x = dict(start=8577000, end=8585500, bounds=None)
mercator_extent_y = dict(start=3315000, end=3323000, bounds=None)
def test(curdoc):
curdoc.clear()
x_range = Range1d(**mercator_extent_x)
y_range = Range1d(**mercator_extent_y)
plot = figure(title='',
tools="pan,wheel_zoom",
x_range=x_range,
x_axis_type="mercator",
y_axis_type="mercator",
y_range=y_range,
width=700,
sizing_mode='stretch_width') # create a figure
curdoc.add_root(plot)
apps = {'/': Application(FunctionHandler(test))}
server = Server(apps, port=5007)
server.start()