Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to run this with scotty results in the app reloading every request. #3

Open
markhibberd opened this issue Oct 27, 2014 · 2 comments

Comments

@markhibberd
Copy link

The command running is:

cabal exec -- ./tmp/.cabal-sandbox/bin/reserve -p 10080 main/dev.hs

Where dev.hs just runs 'scotty 10080 '.

When going to the page it just reloads on every request (a sample):

Interrupted.
Setting phasers to stun... (port 10080) (ctrl-c to quit)
GET /images/aaa.png
  Accept: image/webp,*/*;q=0.8
  Status: 200 OK 0.000052s
Interrupted.
Setting phasers to stun... (port 10080) (ctrl-c to quit)
GET /css/reset.css
  Accept: text/css,*/*;q=0.1
  Status: 200 OK 0.000068s
Interrupted.
Setting phasers to stun... (port 10080) (ctrl-c to quit)
GET /css/typography.css
  Accept: text/css,*/*;q=0.1
  Status: 200 OK 0.00006s
Interrupted.
Setting phasers to stun... (port 10080) (ctrl-c to quit)
GET /css/base.css
  Accept: text/css,*/*;q=0.1
  Status: 200 OK 0.000062s
Interrupted.

Any ideas, I assume it is something to do with how I am starting scotty maybe.

@sol
Copy link
Owner

sol commented Oct 28, 2014

Hey, this is just a missing feature!

Currently we go for the conservative approach of always reloading on every new request. This has the advantage that we never serve a stale application.

If we only want to reload on modifications we need to decide what files to watch (probably making it configurable). I just pushed some mock up code that watches *.hs and *.lhs files. @markhibberd would you be interested to give that a try and provide feedback? The code is on branch reload-on-modifications (see #4).

@creichert
Copy link

@sol I've been using that feature for quite a long time now and it works well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants