Skip to content
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

Implement retries (#56) #86

Merged
merged 9 commits into from
Jul 22, 2021
Merged

Implement retries (#56) #86

merged 9 commits into from
Jul 22, 2021

Conversation

Spiritreader
Copy link
Contributor

@Spiritreader Spiritreader commented Jul 19, 2021

Overview

This pull request implements the retry functionality mentioned in #21

It follows the outlined draft (#56) pretty closely, except for a bit more frontend fixes to display the correct color and strings when the service is pending (retrying)

Also for now, if a service enters the retry condition, hearbeats with that status do not count towards the uptime calculation.

This change requires a database migration for existing uptime kuma installations.

The new table looks like this:

CREATE TABLE "monitor" (
	"id"	INTEGER NOT NULL,
	"name"	VARCHAR(150),
	"active"	BOOLEAN NOT NULL DEFAULT 1,
	"user_id"	INTEGER,
	"interval"	INTEGER NOT NULL DEFAULT 20,
	"url"	TEXT,
	"type"	VARCHAR(20),
	"weight"	INTEGER DEFAULT 2000,
	"hostname"	VARCHAR(255),
	"port"	INTEGER,
	"created_date"	TIMESTAMP,
	"keyword"	VARCHAR(255),
	"maxretries"	INTEGER NOT NULL DEFAULT 0,
	PRIMARY KEY("id" AUTOINCREMENT),
	FOREIGN KEY("user_id") REFERENCES "user"("id") ON DELETE SET NULL ON UPDATE CASCADE
);

The monitor table received another field maxretries

The required migration script is NOT part of this PR, however the initial database has been updated accordingly.

Screenshot

image

backend:
- new field for monitor: maxretries
- new pending status while service is retrying: 2
- pending status event is not marked important
- pending pings however register as downtime in the calculation

frontend:
- added pending status while service is retrying
- added color for new pending status
- added field to configure amount of retries

database:
- IMPORTANT: THIS REQUIRES MIGRATION!!!!
- added field: maxretries with default value 0
@louislam louislam added the feature-request Request for new features to be added label Jul 20, 2021
@louislam louislam added this to the 1.0.7 milestone Jul 20, 2021
src/pages/EditMonitor.vue Outdated Show resolved Hide resolved
.gitignore Show resolved Hide resolved
Spiritreader and others added 2 commits July 20, 2021 17:38
Co-authored-by: Adam Stachowicz <saibamenppl@gmail.com>
@Saibamen
Copy link
Contributor

@louislam: Do we have automatic DB migrations at server startup?

@louislam
Copy link
Owner

@louislam: Do we have automatic DB migrations at server startup?

Yes, I am implementing this.

src/pages/EditMonitor.vue Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:monitor Everything related to monitors feature-request Request for new features to be added type:enhance-existing feature wants to enhance existing monitor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implementing the retries enhancement
4 participants