Seed the populate_db random number generator.

This makes it not to produce 10 copies of each message.

(imported from commit 35ab5f14ec104b4ea52137dac4fa2840194f3777)
This commit is contained in:
Tim Abbott 2012-10-22 13:47:27 -04:00
parent f26a614bb3
commit a695732bda
1 changed files with 2 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import simplejson
import datetime
import random
import sys
import os
import time
import hashlib
import base64
@ -509,6 +510,7 @@ def restore_saved_messages():
# - both single and multi-line content
def send_messages(data):
(tot_messages, personals_pairs, options, output) = data
random.seed(os.getpid())
from django.db import connection
connection.close()
texts = file("zephyr/management/commands/test_messages.txt", "r").readlines()