1
0
mirror of https://gitlab.crans.org/bde/nk20-scripts synced 2025-06-29 09:50:54 +02:00

add timed decorator for perf tracking

This commit is contained in:
Pierre-antoine Comby
2020-05-25 01:12:31 +02:00
parent 996ac3c337
commit f367b0ab2a
3 changed files with 22 additions and 2 deletions

View File

@ -15,7 +15,7 @@ from note.models import Note, NoteUser, NoteClub
from note.models import Alias
from member.models import Club, Profile
from ._import_utils import ImportCommand, BulkCreateManager
from ._import_utils import ImportCommand, BulkCreateManager, timed
M_DURATION = 396
M_START = datetime.date(2019, 8, 31)
@ -44,6 +44,8 @@ class Command(ImportCommand):
def add_arguments(self, parser):
parser.add_argument('-a', '--alias', action='store_true', help="import alias")
@timed
@transaction.atomic
def import_account(self, cur, chunk_size):
"""
@ -157,6 +159,7 @@ class Command(ImportCommand):
bulk_mgr.done()
self.print_success("comptes table imported")
@timed
def import_alias(self, cur, chunk_size):
"""
Import Alias from nk15