diff options
author | Preston Cody <codeman@gentoo.org> | 2006-05-18 23:25:29 +0000 |
---|---|---|
committer | Preston Cody <codeman@gentoo.org> | 2006-05-18 23:25:29 +0000 |
commit | 3a30b292d280e9b2262e8e457648f593de4d109e (patch) | |
tree | 60af97592d58d6b7d04afce91a008d4c905e1ff5 /docs | |
parent | Add scireserver.py and two classes it uses. (diff) | |
download | scire-3a30b292d280e9b2262e8e457648f593de4d109e.tar.gz scire-3a30b292d280e9b2262e8e457648f593de4d109e.tar.bz2 scire-3a30b292d280e9b2262e8e457648f593de4d109e.zip |
adding little doc I wrote on the train home
svn path=/; revision=61
Diffstat (limited to 'docs')
-rwxr-xr-x | docs/server_be_job_transfer.txt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/docs/server_be_job_transfer.txt b/docs/server_be_job_transfer.txt new file mode 100755 index 0000000..cebe361 --- /dev/null +++ b/docs/server_be_job_transfer.txt @@ -0,0 +1,29 @@ +make DB connection
+
+Validate client_id and token.
+Client will also send a list of job_id's it already has. store as ids_client_already_has.
+
+query = "SELECT * FROM jobs WHERE client_id="+client_id+" and status='pending' ORDER BY priority"
+foreach row in results:
+ if job_id in ids_client_already_has: continue
+ Serialize job. keep in memory. as jobs[job_id]
+ write job to disk as XML. md5 it. store in memory as md5s[job_id]
+ push job_id onto list of jobs_to_send.
+
+while jobs_to_send:
+ pop current_job from jobs_to_send
+ send jobs[current_job]
+ send md5s[current_job]
+ wait a bit for a response... if timeout, push current_job back onto jobs_to_send.
+ if response == "BadMD5":
+ log event to error log.
+ push current_job onto jobs_to_send
+ # job will get resent the next time around.
+ # moves to bottom of queue incase it is a recurring problem
+ # so it doesn't hold up all the other jobs?
+ # this is OK because it will be resorted by priority on the client's end.
+ if response == "OK":
+ query = "UPDATE jobs SET status='received' WHERE job_id="+current_job
+ continue #move onto next job. This is in the client's hands now.
+
+close DB connection.
\ No newline at end of file |