From 53967167a2255704e8ed5111abeec9cdc6321dc3 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 20 Sep 2014 02:49:19 +0000 Subject: improved concurrency diff --git a/index.html b/index.html index c781d6c..2c708f5 100644 --- a/index.html +++ b/index.html @@ -85,8 +85,6 @@ group_carts.push(cart); } ); - - updateShowListing(); } function updateShowCartList(data, status, req) { @@ -94,13 +92,12 @@ var cartlist = $(data).find("logList"); var carts = cartlist.children(); carts.each(function() { - show_carts.push($(this).find('cartNumber').text()); + var number = $(this).find('cartNumber').text(); + if(number >= 100000) { // TODO: hardcoded value.... + show_carts.push(number); + } } ); - - group_carts = []; - data = { COMMAND: 6, LOGIN_NAME: username, PASSWORD: token, GROUP_NAME: current_show.group, INCLUDE_CUTS: 1 }; - $.post("/rd-bin/rdxport.cgi", data, updateGroupCartList, "xml"); } function showSelectedShow() { @@ -114,9 +111,22 @@ show_carts = []; data = { COMMAND: 22, LOGIN_NAME: username, PASSWORD: token, NAME: current_show.log }; - $.post("/rd-bin/rdxport.cgi", data, updateShowCartList, "xml"); + scd = $.post("/rd-bin/rdxport.cgi", data, updateShowCartList, "xml"); + + group_carts = []; + data = { COMMAND: 6, LOGIN_NAME: username, PASSWORD: token, GROUP_NAME: current_show.group, INCLUDE_CUTS: 1 }; + gcd = $.post("/rd-bin/rdxport.cgi", data, updateGroupCartList, "xml"); + + $.when(scd, gcd).done( + function(scres, gcres) { + if(scres[1] == 'success' && gcres[1] == 'success') { + updateShowListing(); + } + } + ); } + function updateShowsList(data, status, req) { shows_list = []; $('#show-selector').find('option').remove(); -- cgit v0.10.2