Skip to content

Commit

Permalink
Add util script master (#148)
Browse files Browse the repository at this point in the history
* add util_s

* shorten waitime
  • Loading branch information
robertavram authored Sep 16, 2016
1 parent aa29da3 commit 8ac8270
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions EquiTrack/EquiTrack/util_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def fix_indicator_code():
for ind in indicators:
ind.code = None
ind.save()
time.sleep(3)
time.sleep(1)
fix_indicator_code()

def relates_to_anything(cobj):
Expand Down Expand Up @@ -157,11 +157,12 @@ def _run_clean(prop, dupes):
printtf("ERROR OCCURED ON RECORD", dpres.id, dpres)
continue
delq.append(dpres)
time.sleep(0.3)
time.sleep(0.1)
if not len(delq):
printtf("Nothing is getting removed for {}".format(dupes))
else:
# delete everyting in the queue

[i.delete() for i in delq]
printtf("deleting: ", delq)
# get all duplicates that have the same wbs
Expand Down Expand Up @@ -191,7 +192,7 @@ def get_cpwbs(wbs):
tomorrow = today + timedelta(days=365)
cp, created = CountryProgramme.objects.get_or_create(wbs=locpwbs[i], name='Country Programme '+str(i), from_date=today, to_date=tomorrow)

time.sleep(5)
time.sleep(1)

for res in results:
cp = CountryProgramme.objects.get(wbs=get_cpwbs(res.wbs))
Expand Down

0 comments on commit 8ac8270

Please sign in to comment.