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

startup checklist: update Starter shift end time on submit #4

Open
dneise opened this issue Mar 6, 2017 · 1 comment
Open

startup checklist: update Starter shift end time on submit #4

dneise opened this issue Mar 6, 2017 · 1 comment

Comments

@dneise
Copy link
Member

dneise commented Mar 6, 2017

Once the Starter submits the startup-checklist, the currently running Starter shift ends and the shifter takes over. This is done be UPDATEing and entry in the new shiftcalendar table called calendarentry.

The query to find the current Starter shift might look like this:

UPDATE calendarentry c 
JOIN role r ON (c.role_id = r.id)
SET c.end = NOW()
WHERE r.name="Shifter_Awake"
              AND start<NOW()
              AND NOW()<end

The problem comes, when a Starter tries to submit the checklist twice. Then this update will not work, since there is no Starter on shift anymore.

Also, when if just somebody submits the startup-checklist? Then the starter is not on shift anymore. From security point of view this is fine. The shifter will be callend ... then the fallback ... then the developers. ..
But restoring the state is not too easy ... I mean sure ... find the last entry in startup_checklist_filled and remove it. Note the created timestamp. Find the Starter entry with the same timestamp and set the endtime to the next "Parker" entry.

However this is all functionality that needs to be coded ... and that ... well ... is just a lot of work.
So this must not go wrong ... but it will ...

@dneise
Copy link
Member Author

dneise commented Mar 6, 2017

The last problem can also be solved like this:

Only the person currently being starter can submit the startup-checklist.
This might be too much for my PHP foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant