Changeset 1010 for trunk/common
- Timestamp:
- 03/01/09 12:43:38 (3 years ago)
- Location:
- trunk/common/db
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/common/db/round.php
r1007 r1010 161 161 // 162 162 // $tasks is array of task id's 163 function round_update_task_list($round_id, $ tasks) {163 function round_update_task_list($round_id, $old_tasks, $tasks) { 164 164 log_assert(is_round_id($round_id)); 165 165 … … 169 169 db_escape($round_id)); 170 170 db_query($query); 171 172 log_print_r($tasks); 173 log_print(count($tasks)); 171 foreach($old_tasks as $task) { 172 // Update parent round cache for old tasks 173 task_get_parent_rounds($task, true); 174 } 174 175 175 176 if (count($tasks) > 0) { … … 182 183 VALUES ". implode(', ', $values); 183 184 db_query($query); 185 foreach($tasks as $task) { 186 // Update parent round cache for new tasks 187 task_get_parent_rounds($task, true); 188 } 184 189 } 185 190 } -
trunk/common/db/task.php
r997 r1010 132 132 133 133 // Returns list of round ids that include this task 134 function task_get_parent_rounds($task_id ) {134 function task_get_parent_rounds($task_id, $force_no_cache=false) { 135 135 log_assert(is_task_id($task_id)); 136 if (!$force_no_cache) { 137 $result = mem_cache_get("task-rounds-by-id:$task_id"); 138 if ($result !== false) { 139 return $result; 140 } 141 } 142 136 143 $query = sprintf(" 137 144 SELECT DISTINCT round_id … … 149 156 } 150 157 158 mem_cache_set("task-rounds-by-id:$task_id", $idlist); 151 159 return $idlist; 152 160 }
Note: See TracChangeset
for help on using the changeset viewer.
![[infoarena] development](/chrome/site/logo.png)