[TW5] Run Tiddlywiky wrapped in nodemon?

123 views
Skip to first unread message

Ron Poulin

unread,
May 24, 2015, 9:44:49 PM5/24/15
to tiddl...@googlegroups.com
Hi,

I am trying to run tiddlywiky server in nodemon. Nodemon is a great way to recover a failed node server using autorestart.  I have been able to run my own server in nodemon but need some help with running tiddlywiky in that environment. 

As it stands, tiddlywiki is run out of a bash shell on linux. This is a very good method however it is oriented towards a bash environment.  Nodemon is a wrapper for nodejs and I haven't been able to figure it out as I am still an experienced newbe with node.  Has anyone done this?  The part that escapes me is passing the parameters into nodemon and establishing the correct environment variables needed by the tiddlywiki server.

This may not be a possible way of running the tiddlywiky server but I thought I should ask if anyone had an experience with this approach.

Ron

See nodemon site for reference: https://github.com/remy/nodemon

PMario

unread,
May 25, 2015, 4:10:52 AM5/25/15
to tiddl...@googlegroups.com
Hi Ron,

Did you try to start a simple nodemon test script, that just watches your tw edition tree and creates debug output.

What happens if, TW server and nodmoen runs and a file was changed by the TW server. ... If nodemon fires, imo it is useless. Since it will restart TW server with every tiddler you create or modify. IMO those tools are designed for a completely different workflow and purpose.

What we really want is a watcher, that only restarts TW server if tiddlers are created, modified or deleted from the user. If the server changes tiddlers nothing should happen.

So imo what's needed is a new TW command eg: --watch, that initializes a file watcher and restarts TW simpleserver only if something was changed by hand.

just my 2 cents
-mario





PMario

unread,
May 25, 2015, 4:41:02 AM5/25/15
to tiddl...@googlegroups.com
I had a closer look, to the TW boot mechanism. ...
There are more important things, that you may have missed.
TiddlyWiki allows you to include content from other wikis. Information is stored in tiddlywiki.info and may also come from environment variables.

So imo the only place to add a file watching mechanism, that works is in the TW filesystemadaptor.

-m

Ron Poulin

unread,
May 25, 2015, 6:39:41 AM5/25/15
to tiddl...@googlegroups.com

PMario,
Good point: wrong tool. I should be looking for a utility that would watch the listener and restart the process if it fails.
Thanks

Ron Poulin

unread,
May 25, 2015, 7:48:08 AM5/25/15
to tiddl...@googlegroups.com
Hi Mario,
Yep, I see that as well. Thanks for helping out on this question. Much appreciated,

Ron

PMario

unread,
May 25, 2015, 4:16:23 PM5/25/15
to tiddl...@googlegroups.com
I found a tool [1], that may have, the concept, that we need. ... but still more overhead as we want.
TW already traverses all directories at startup, but it doesn't maintain additional events, that tell us, that something has changed outside the server.

Watch itself can't be used with TW since it has the wrong license.

-m

https://github.com/mikeal/watch/blob/master/main.js

Ron Poulin

unread,
May 25, 2015, 5:11:34 PM5/25/15
to tiddl...@googlegroups.com
Mario,
I agree. The solution to this would be an external monitoring process and an internal responder.  I looked at process-watcher / monitor that look promising as concepts.

See: https://github.com/yahoo/process-watcher


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/UIudjLqCrVw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c09f22f5-20e7-4cb6-b48d-5ee9738dd446%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PMario

unread,
May 26, 2015, 1:17:23 AM5/26/15
to tiddl...@googlegroups.com
On Monday, May 25, 2015 at 11:11:34 PM UTC+2, Ron Poulin wrote:
Mario,
I agree. The solution to this would be an external monitoring process and an internal responder.  I looked at process-watcher / monitor that look promising as concepts.

See: https://github.com/yahoo/process-watcher

uups, I think, I did misunderstand your OP a little bit. ... You want to auto-restart a failed server.

Since you were proposing a file watcher, I was thinking in the wrong direction.
We have several requests in other threads, that want to restart the server, if someone changed / added a tiddler by hand. .. So my responses my be "strange" for you.

So yes a process watcher may be the right tool for your OP. The only problem is, that "how do you know, that the server failed"?
The tw app can hang, but the process may be still alive. imo there is no hartbeat at the moment.

-mario




-mario

Jeremy Ruston

unread,
May 27, 2015, 8:51:14 AM5/27/15
to TiddlyWiki
Hi Mario

So yes a process watcher may be the right tool for your OP. The only problem is, that "how do you know, that the server failed"?
The tw app can hang, but the process may be still alive. imo there is no hartbeat at the moment.

One approach would be to intermittently perform an HTTP HEAD operation on /, and assume that the process is crashed if it doesn't respond in 30 seconds.

Best wishes

Jeremy.

 

-mario




-mario

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.

For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com
Reply all
Reply to author
Forward
0 new messages