<commit_before>package rapture.kernel.pipeline;

import rapture.common.DocUpdateObject;
import rapture.common.model.DocumentWithMeta;
import rapture.kernel.ContextFactory;
import rapture.object.storage.ObjectStorageSearchable;
/**
 * A helper class that understands the ins and outs of ObjectStorage objects, and has the correct defaults before sending to
 * Search Publisher
 * @author alanmoore
 *
 */
public class ObjectStorageSearchPublisher {
	private static ObjectStorageSearchable searchable = new ObjectStorageSearchable();
	
    public static void publishCreateMessage(DocumentWithMeta doc) {
        publishCreateMessage(new DocUpdateObject(doc));
    }

    public static void publishCreateMessage(DocUpdateObject duo) {
        SearchPublisher.publishCreateMessage(ContextFactory.getAnonymousUser(), searchable, duo);
    }
}<commit_msg>Publish message in a thread to avoid timing issues (was interfering with unit tests)<commit_after>package rapture.kernel.pipeline;

import org.apache.log4j.Logger;

import rapture.common.DocUpdateObject;
import rapture.common.model.DocumentWithMeta;
import rapture.kernel.ContextFactory;
import rapture.object.storage.ObjectStorageSearchable;
/**
 * A helper class that understands the ins and outs of ObjectStorage objects, and has the correct defaults before sending to
 * Search Publisher
 * @author alanmoore
 *
 */
public class ObjectStorageSearchPublisher {
	private static ObjectStorageSearchable searchable = new ObjectStorageSearchable();
    private static final Logger log = Logger.getLogger(ObjectStorageSearchable.class);

    public static void publishCreateMessage(final DocumentWithMeta doc) {
        log.info("ObjectStorageSearchPublisher - publishing message...");
        new Thread() {
            @Override
            public void run() {
                publishCreateMessage(new DocUpdateObject(doc));
            }
        }.start();
        log.info("... message published");
    }

    public static void publishCreateMessage(DocUpdateObject duo) {
        SearchPublisher.publishCreateMessage(ContextFactory.getAnonymousUser(), searchable, duo);
    }
}
{'fraction_non_alphanumeric': 0.0760920620009394, 'fraction_numerical': 0.0004697040864255519, 'mean_word_length': 4.433673469387755, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2501950', 'n_tokens_mistral': 536, 'n_tokens_neox': 510, 'n_words': 151}