Skip to content

Files

Latest commit

56bd373 · Apr 25, 2016

History

History

refresh_model

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 18, 2016
Apr 25, 2016
Apr 18, 2016

Refresh Model

What is this?

This is a Gearman worker that, when given a user, looks through the vote collection in the database for all votes made by that user, and creates a new classification model for them, putting it in their document in the user collection.

Usage

The worker is called refresh-model, and takes the following Gearman input data:

{
    "key": "secret_key_abc",
    "username": "sully"
}

The username field is optional. If it is not supplied, the worker will operate upon all users.

It outputs either:

{
    "status": "success"
}

or

{
    "status": "error",
    "description": "error description"
}

How to do tests

To run the tests, move to this repository, and run:

$ python testing.py

To add a test, modify the testing.py file.