Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuild how failed logs are removed to be a cron #42

Open
mgwidmann opened this issue Oct 10, 2017 · 0 comments
Open

Rebuild how failed logs are removed to be a cron #42

mgwidmann opened this issue Oct 10, 2017 · 0 comments

Comments

@mgwidmann
Copy link
Owner

PRs are crashing due to a foreign key constraint error (which is good because that means it cannot delete something it should not).

Task #PID<0.2979.0> started from :"pr-somerepo-12345" terminating
** (Ecto.ConstraintError) constraint error when attempting to insert struct:

    * foreign_key: random_failures_failure_log_id_fkey

If you would like to convert this constraint into an error, please
call foreign_key_constraint/3 in your changeset and define the proper
constraint name. The changeset has not defined any constraint.

    (ecto) lib/ecto/repo/schema.ex:570: anonymous fn/4 in Ecto.Repo.Schema.constraints_to_errors/3
    (elixir) lib/enum.ex:1255: Enum."-map/2-lists^map/1-0-"/2
    (ecto) lib/ecto/repo/schema.ex:555: Ecto.Repo.Schema.constraints_to_errors/3
    (ecto) lib/ecto/repo/schema.ex:219: anonymous fn/14 in Ecto.Repo.Schema.do_insert/4
    (ecto) lib/ecto/repo/schema.ex:768: anonymous fn/3 in Ecto.Repo.Schema.wrap_in_transaction/6
    (ecto) lib/ecto/adapters/sql.ex:576: anonymous fn/3 in Ecto.Adapters.SQL.do_transaction/3
    (db_connection) lib/db_connection.ex:1275: DBConnection.transaction_run/4
    (db_connection) lib/db_connection.ex:1199: DBConnection.run_begin/3
Function: &SlackCoder.Services.RandomFailureService.save_random_failure/1

Rebuild it to periodically clean up randomly failed jobs that are not necessary to be kept around any longer instead of cleaning up the jobs as they are completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant