Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
56747fce
Commit
56747fce
authored
Dec 20, 2012
by
Sofia Papagiannaki
Browse files
Fix sync_projects
parent
1ec0da3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
snf-astakos-app/astakos/im/models.py
View file @
56747fce
...
...
@@ -1839,10 +1839,16 @@ def new_serial():
s
.
delete
()
return
serial
def
sync_finish_serials
():
serials_to_ack
=
set
(
qh_query_serials
([]))
def
sync_finish_serials
(
serials_to_ack
=
None
):
if
serials_to_ack
is
None
:
serials_to_ack
=
qh_query_serials
([])
serials_to_ack
=
set
(
serials_to_ack
)
sfu
=
ProjectMembership
.
objects
.
select_for_update
()
memberships
=
sfu
.
filter
(
pending_serial__isnull
=
False
)
memberships
=
list
(
sfu
.
filter
(
pending_serial__isnull
=
False
))
if
not
memberships
:
return
0
for
membership
in
memberships
:
serial
=
membership
.
pending_serial
...
...
@@ -1853,6 +1859,7 @@ def sync_finish_serials():
transaction
.
commit
()
qh_ack_serials
(
list
(
serials_to_ack
))
return
len
(
memberships
)
def
sync_projects
():
sync_finish_serials
()
...
...
@@ -1905,7 +1912,11 @@ def sync_projects():
# Need to check in ProjectMembership.set_sync()
r
=
qh_add_quota
(
serial
,
sub_quota
,
add_quota
)
sync_finish_serials
()
if
r
:
m
=
"cannot sync serial: %d"
%
serial
raise
RuntimeError
(
m
)
sync_finish_serials
([
serial
])
def
trigger_sync
(
retries
=
3
,
retry_wait
=
1.0
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment