-
Notifications
You must be signed in to change notification settings - Fork 32
CON-72 notify when device is offline #447
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
base: develop
Are you sure you want to change the base?
Conversation
460f813
to
84be43d
Compare
499fe62
to
a454487
Compare
Kindly include how to test the PR on the comment |
cb17143
to
44acb26
Compare
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.
Nice implementation. The notifications are being created
1b2da8b
to
d67684b
Compare
0bcf20d
to
7f05d61
Compare
763aff5
to
b7b5fad
Compare
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.
@Arusey Kindly fix your commit messages. You have more than 1.
4e6154b
to
e1c0d89
Compare
Done |
218fa32
to
fedf9ec
Compare
- create device is offline notification - periodically check the device last seen - add too states for a device: online or offline [Finishes CON-72]
fedf9ec
to
8056793
Compare
class AdminNotification(Base, Utility): | ||
__tablename__ = 'admin_notifications' | ||
|
||
id = Column(Integer, primary_key=True) # noqa |
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.
I don't think we need # noqa
here as this line of code is pep8
compliant.
|
||
|
||
class Devices(Base, Utility): | ||
__tablename__ = 'devices' | ||
id = Column(Integer, Sequence('devices_id_seq', start=1, increment=1), primary_key=True) # noqa | ||
id = Column(Integer, Sequence('devices_id_seq', start=1, increment=1), primary_key=True) # noqa |
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.
The change on this line is not needed
Description
This Pull request allows an administrator for the converge web app to receive notifications whenever a device has not been seen in a while.
Type of Change
How can this be tested
checkout to the branch and run migrations using
make migrate message="migration message"
Install dependencies using
pip install -r requirements.txt
Ensure your database has a number of devices in which their activity is online - their last seen should also be greater than a day relative to the current time
Run the following command on a different terminal to startup your scheduler
celery worker -A cworker.celery --loglevel=info
celery -A cworker.celery beat -l info
create an index.html on your browser using the script attached below and inspect your console.