Ignore:
Timestamp:
May 31, 2012, 2:59:36 AM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
b32adb6
Parents:
d768e47
git-author:
Alex Dehnert <adehnert@…> (05/31/12 02:37:46)
git-committer:
Alex Dehnert <adehnert@…> (05/31/12 02:59:36)
Message:

Use transaction.commit_on_success for imports

Fixed the following scripts:

  • forms/update_validations.py (15s->1s for 70ish validations)
  • space/import_into_db.py (67s->1s for 75 spaces and 100 assignments)
  • util/sync_moira_authz.py (65s->4s for importing ~50 new people)

util/update_old_previews.py was skipped:

  • it's dead code, I believe --- I think previews are unused
  • preview updating is slow, IIRC; it's dubious we'd get noticeably better runtime on the script, and there may even be utility to the progress updates not doing this transactionally supplies

This closes ASA Trac #59.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/forms/update_validations.py

    r654c9af rdf88ee9  
    1212    os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
    1313
     14from django.db import transaction
     15
    1416import forms.models
    1517import groups.models
    1618
    1719
     20@transaction.commit_on_success
    1821def revalidate_confirmations():
    1922    confirmations = forms.models.PersonMembershipUpdate.objects.filter(deleted__isnull=True, valid=forms.models.VALID_UNSET)
Note: See TracChangeset for help on using the changeset viewer.