Merge branch 'master' of github.com:dgtlmoon/changedetection.io

pull/73/head
dgtlmoon 4 years ago
commit 91f69b92a2

@ -25,6 +25,7 @@ Know when ...
- New software releases, security advisories when you're not on their mailing list. - New software releases, security advisories when you're not on their mailing list.
- Festivals with changes - Festivals with changes
- Realestate listing changes - Realestate listing changes
- COVID related news from government websites
**Get monitoring now! super simple, one command!** **Get monitoring now! super simple, one command!**

@ -334,6 +334,17 @@ def changedetection_app(conig=None, datastore_o=None):
url = request.form.get('url').strip() url = request.form.get('url').strip()
tag = request.form.get('tag').strip() tag = request.form.get('tag').strip()
minutes_recheck = request.form.get('minutes')
if minutes_recheck:
minutes = int(minutes_recheck.strip())
if minutes >= 1:
datastore.data['watching'][uuid]['minutes_between_check'] = minutes
else:
messages.append(
{'class': 'error', 'message': "Must be atleast 1 minute."})
# Extra headers # Extra headers
form_headers = request.form.get('headers').strip().split("\n") form_headers = request.form.get('headers').strip().split("\n")
extra_headers = {} extra_headers = {}
@ -856,9 +867,16 @@ def ticker_thread_check_time_launch_checks():
threshold = time.time() - (minutes * 60) threshold = time.time() - (minutes * 60)
for uuid, watch in datastore.data['watching'].items(): for uuid, watch in datastore.data['watching'].items():
# If they supplied an individual entry minutes to recheck and its not the same as the default
if 'minutes_between_check' in watch and minutes != watch['minutes_between_check']:
threshold = time.time() - (watch['minutes_between_check'] * 60)
if not watch['paused'] and watch['last_checked'] <= threshold: if not watch['paused'] and watch['last_checked'] <= threshold:
if not uuid in running_uuids and uuid not in update_q.queue: if not uuid in running_uuids and uuid not in update_q.queue:
update_q.put(uuid) update_q.put(uuid)
time.sleep(1)
# Should be low so we can break this out in testing # Should be low so we can break this out in testing
app.config.exit.wait(1) app.config.exit.wait(1)

@ -55,6 +55,7 @@ class ChangeDetectionStore:
'last_viewed': 0, # history key value of the last viewed via the [diff] link 'last_viewed': 0, # history key value of the last viewed via the [diff] link
'newest_history_key': "", 'newest_history_key': "",
'title': None, 'title': None,
'minutes_between_check': 3 * 60, # Default 3 hours
'previous_md5': "", 'previous_md5': "",
'uuid': str(uuid_builder.uuid4()), 'uuid': str(uuid_builder.uuid4()),
'headers': {}, # Extra headers to send 'headers': {}, # Extra headers to send

@ -17,6 +17,13 @@
<input type="text" placeholder="tag" size="10" id="tag" name="tag" value="{{ watch.tag}}"/> <input type="text" placeholder="tag" size="10" id="tag" name="tag" value="{{ watch.tag}}"/>
<span class="pure-form-message-inline">Grouping tags, can be a comma separated list.</span> <span class="pure-form-message-inline">Grouping tags, can be a comma separated list.</span>
</div> </div>
</br>
<div class="pure-control-group">
<label for="minutes">Maximum time in minutes until recheck.</label>
<input type="text" id="minutes" name="minutes" value="{{watch.minutes_between_check}}"
size="5"/>
<span class="pure-form-message-inline">Minimum 1 minute between recheck</span>
</div>
<!-- @todo: move to tabs ---> <!-- @todo: move to tabs --->
<fieldset class="pure-group"> <fieldset class="pure-group">

@ -10,7 +10,8 @@
<label for="minutes">Maximum time in minutes until recheck.</label> <label for="minutes">Maximum time in minutes until recheck.</label>
<input type="text" id="minutes" required="" name="minutes" value="{{minutes}}" <input type="text" id="minutes" required="" name="minutes" value="{{minutes}}"
size="5"/> size="5"/>
<span class="pure-form-message-inline">This is a required field.</span> <span class="pure-form-message-inline">This is a required field.</span><br/>
<span class="pure-form-message-inline">Minimum 1 minute between recheck</span>
</div> </div>
<br/> <br/>
<hr> <hr>

Loading…
Cancel
Save