Comments (4)
Yes. There's any number of ways to do this, we could just have a TORNADO_SETTINGS
dict in the default_settings.py
populated from the "simple" settings and let people override that completely, or merge it with the existing settings (STATIC_DIR_PATH
, etc.).
from ndscheduler.
I've got a patch which I'll test in the next few days, and then I'll submit a PR. I've mulled over the options and decided to do it as an optional argument to the constructor. I chose that approach rather than putting the dictionary in default_settings.py
because (if I'm reading the code correctly) the approach used for overrides of the values in that module would replace the dictionary wholesale. That might be appropriate for database settings, but I believe for the tornado settings it is preferable to let the user override or add a single setting value, without having to maintain the others in the dictionary. That gives you the most flexibility down the road (for example, adding a new tornado setting that you don't want to be inadvertently dropped because it wasn't in the user's dictionary). Your thoughts?
from ndscheduler.
I just realized that (again, if I'm reading the code correctly) there's another incentive to use an optional parameter for the SchedulerServer
constructor instead of putting the default dictionary of tornado
settings in default_settings.py
. Most of the values which the constructor is currently using for the self.tornado_settings
dictionary are not available until after the ndscheduler.settings
dictionary has been assembled. So we'd have a chicken-and-egg problem. Currently, the user can assume that when he or she overrides DEBUG
(for example), that new value will show up in the dictionary passed to tornado
. That assumption would be broken if we put the TORNADO_SETTINGS
in default_settings.py
. It would be possible, of course, to provide the support for this enhancement by adding all of the settings supported by tornado
individually in default_settings.py
, but that puts you in the awkward position of having to track changes to the set of settings supported by tornado
, whereas the proposed approach would let the user override any new settings introduced by tornado
without the need for any changes to ndscheduler
.
from ndscheduler.
@bkline the ndscheduler.settings
object gets instantiated at module load time, so I think any changes you make in the settings module should show up by the time you call SchedulerServer.run()
. That said, you've clearly put more thought in to this feature than I have and I don't have any objections to doing it as an optional constructor arg - in fact, if I'm going to be totally honest, my personal opinion is that this repo is (or should be) a library*, libraries should not manage "settings", and therefore everything SchedulerServer
depends on should be constructor arguments, and it's up to users of the library how they want to manage whatever "settings" are necessary to instantiate the server.
But, for better or worse, that's not how it's designed right now and I'm not about to refactor it to follow that design (which would require making run
an instance method and be a breaking change, with all that implies, and I just don't have time at the moment). That said, I'm certainly not about to stand in the way of moving the project in that direction.
- with the exception of the "simple_server" directory, which should probably be it's own repo anyhow
from ndscheduler.
Related Issues (20)
- Info; ndscheduler make simple fail HOT 2
- make simple fails possibly due to problem with virtualenv version HOT 1
- The Jobs-Site sorts the "Job Name" Column wrong HOT 1
- Maintained? HOT 1
- Missing argument "db_tablenames" with APScheduler
- possible error in ndscheduler/server/server.py
- No versioning
- UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 74: ordinal not in range(128)
- Getting Job Name? HOT 4
- Job Name - Again HOT 1
- Adding Custom Fields to Job in Web UI
- Jobs stuck at "running" HOT 2
- Run job every 15 seconds
- Cannot run a job with the rest api
- No data validation hangs scheduler.
- Not able to use MySQL HOT 1
- How To auto-reload or restart scheduler without error Address already in use HOT 1
- Confusing licence badge on README.md HOT 1
- Unable to run manual settings rather than default settings HOT 1
- Conflict with Notebook package in the same environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ndscheduler.