Skip to content

Commit

Permalink
adds track counter to processing message log in bulk track upload
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaka committed Jun 8, 2020
1 parent 9cc32de commit 73e300a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions airscore/core/trackUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def assign_and_import_tracks(files, task, xcontest=False, user=None, check_g_rec
task_id = task.id
comp_id = task.comp_id
task_date = task.date
track_counter = 0
"""checking if comp requires a regisration.
Then we create a list of registered pilots to check against tracks filename.
This should be much faster than checking against all pilots in database through a query"""
Expand Down Expand Up @@ -124,6 +125,8 @@ def assign_and_import_tracks(files, task, xcontest=False, user=None, check_g_rec
else:
"""pilot is registered and has no valid track yet
moving file to correct folder and adding to the list of valid tracks"""
track_counter += 1
print(f"Track {track_counter}|counter")
mytrack.task_id = task_id
filename_and_path = mytrack.copy_track_file(task_path=track_path, pname=full_name)
# print(f"pilot {mytrack.par_id} associated with track {mytrack.filename}")
Expand Down
6 changes: 6 additions & 0 deletions airscore/templates/users/track_admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,12 @@ <h5 class="modal-title" id="ProcessModalTitle">Tracklog Processing</h5>
var data = JSON.parse(event.data);
$('#progress_percentage'+ data.id).text(data.message + ' % complete');

}, false);

es.addEventListener('counter', function(event) {
var data = JSON.parse(event.data);
$('#ProcessModalTitle').text('Tracklog Processing. ' + data.message);

}, false);

es.addEventListener('info', function(event) {
Expand Down

0 comments on commit 73e300a

Please sign in to comment.