javascript - Approaching an automated system that uses a daily database entry -


I am working on a system to manage students in a boarding school, which is a very complex amount of paperwork As part of this, some students are not boarders and as soon as they leave school to go home. The paperwork involves publishing a list of non-boarding students every day, and after leaving the students themselves have to find themselves.

I repeated this system using the meteor, but I believe that my system is fundamentally flawed, and at the very least it is incredibly likely to be bugs. I have created a 'ticket' database, each ticket records the history of special non-boarding student during a particular day. To start the tickets, the server performs the following tasks every day using a cron job.

insert function () {console.log ("Daily Ticket Generated") var dailyStudents = Meteor.users.find ({"profile.daily": true}); // Daily students to all daily students. EEF (Daily Student) {DAILY UPDATE ({// Dailyies In Ticket is a collection of student: daily student, date: today (). ToDate () // use of moment.js}, {$ SetOnInsert: {Student: dailyStudent, date: today (). ToDate (), left: false, dinner: false, stayLate: false, sleep: false, room: null}}, {upert: true});});

}

Where left , dinner , to stay , and Sleep There may be each student in four non-mutually exclusive states.

The existing system will be acceptable, this is incredibly bug-prone and unreliable - in some cases, the system will generate two tickets each student. While reaching the system immediately after midnight in a timezone other than UTC, tickets sometimes fail to reveal to everyone. Other times related bugs are so many that keep the system up to date.

Is there a better, more bug-resistant approach to tracking each student's status once daily? Is it going to be forced to continue unreliability (rather than an event-driven dependence, like most other tasks), even if I change the existing system from something else?


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -