Closed dneise closed 6 years ago
At this point in time, I realize, that due to the cloning time delay of 5 minutes, the SH will always have an image of the Database which is max. 5 minutes too old. So this check: https://github.com/fact-project/shifthelper/blob/6b841be6f28fb4cac2cb56b6758cfbfd06c55a8b/shifthelper/__main__.py#L226-L230
might fire when it is 10min after shutdown, but the parker has already filled the checklist, but the cloner has not yet cloned the DB again, so the SH looks simply at old data.
Now the condition "is_last_shutdown_already_10min_past" takes the cloning time into account.
The next point I see is: The SH usually makes a connection to the "cloned_db". but the default here: https://github.com/fact-project/shifthelper/blob/6b841be6f28fb4cac2cb56b6758cfbfd06c55a8b/shifthelper/tools/__init__.py#L44-L47 Is the live DB on LaPalma.
I think it would be good to make this default somehow reflect, that we usually use the cloned DB.
The only part in the code not using the cloned DB, is the DB_cloner .. which makes sense.
This PR got a bit too big already ... sorry.
Maybe we could think about merging this?
@MaxNoe ... merge?
So .. I've sometimes gotten developer calls in the night, or also during the day regarding a failed "ParkingChecklistFilled" check.
I looked into the code and saw, that this table is actually not cloned. So I thought, let's go ahead and clone all tables the SH is reading from .. not just some of them.
The reason why this table is not cloned is, that is does not reside in the same DB as the other tables. It is in the sandbox DB.