-
Notifications
You must be signed in to change notification settings - Fork 103
Made develop mode autorun on start #95
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
Conversation
notzippy
commented
Jul 21, 2017
- Modified proxy so application is launched on start of proxy, so a new request is not required to start the application.
- Moved watcher inside harness
Is watcher not used within the revel lib? |
For watching template files, so it can reload them on a change. The source
files have to be watched from harness.. may be able to do this differently
in the future though
…On Thu, Jul 27, 2017, 8:49 PM Brenden Soares, ***@***.***> wrote:
Is watcher not used within the revel lib?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#95 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABUsBhLw38oOdHCQu0bl5tKVvpZMT6Hnks5sSVpTgaJpZM4Of6-f>
.
|
harness/harness.go
Outdated
renderError(w, r, err) | ||
return | ||
// If app did not start when harness was run then trigger the build to capture the error | ||
if h.app==nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h.app == nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
harness/harness.go
Outdated
// Render an error page if the rebuild / restart failed. | ||
err := h.watcher.Notify() | ||
if err != nil { | ||
atomic.CompareAndSwapInt32(&lastRequestHadError, 0, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CompareAndSwapInt32
is kind of obscure, we should add comments to lines referencing this method to communicate our intent which I believe has to do with syncing up the concurrent change to lastRequestHadError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, I guess there could be a race condition where the browser requests the favicon immediately following the page request. I don't know if it is crucial to be this way - but it isnt hurting anything by being there
watcher.Listen(h, paths...) | ||
h.watcher = revel.NewWatcher() | ||
h.watcher.Listen(h, paths...) | ||
h.watcher.Notify() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the line that causes the build in dev mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, the notify triggers the build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h.watcher.Notify()
is yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a comment saying so so the intent is clear?
90d228f
to
196f779
Compare
Modified proxy so application is launched on startup
watcher.Listen(h, paths...) | ||
h.watcher = revel.NewWatcher() | ||
h.watcher.Listen(h, paths...) | ||
h.watcher.Notify() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe add a comment saying so so the intent is clear?