Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

36 rindas
1.9KB

  1. <%
  2. ' Test fixture (tests/phase3-jobs.sh only): puts an ingestion job into states that the API cannot produce on demand,
  3. ' to simulate interruptions and failures. Never use against data you care about.
  4. ' FIX_ACTION=stale FIX_ID=<job> claimed long ago and never finished (process died mid-ingest)
  5. ' FIX_ACTION=failed FIX_ID=<job> FIX_N=<attempts> failed with a retryable internal_error after n attempts
  6. ' FIX_ACTION=corrupt FIX_ID=<job> queued with an unreadable stored input
  7. ' FIX_ACTION=nopayload FIX_ID=<job> failed and its stored input gone
  8. ' FIX_ACTION=nowrite FIX_ID=<principal> removes the principal's grants (permission lost before processing)
  9. ' FIX_ACTION=chunks FIX_ID=<document> prints the number of chunk rows of the document (all revisions)
  10. %>
  11. <!--#include file="../../core/autoload_core.asp" -->
  12. <%
  13. Dim sh, act, id, n, rs
  14. Set sh = CreateObject("WScript.Shell")
  15. act = sh.ExpandEnvironmentStrings("%FIX_ACTION%")
  16. id = sh.ExpandEnvironmentStrings("%FIX_ID%")
  17. n = sh.ExpandEnvironmentStrings("%FIX_N%")
  18. Select Case act
  19. Case "stale"
  20. DAL().Execute "UPDATE jobs SET state = 'running', attempt_count = 1, updated_at = '2000-01-01 00:00:00' WHERE id = ?", id
  21. Case "failed"
  22. DAL().Execute "UPDATE jobs SET state = 'failed', error_code = 'internal_error', attempt_count = " & CLng(n) & ", updated_at = '2000-01-01 00:00:00' WHERE id = ?", id
  23. Case "corrupt"
  24. DAL().Execute "UPDATE jobs SET state = 'queued', payload = '{bad' WHERE id = ?", id
  25. Case "nopayload"
  26. DAL().Execute "UPDATE jobs SET state = 'failed', error_code = 'internal_error', payload = NULL WHERE id = ?", id
  27. Case "nowrite"
  28. DAL().Execute "DELETE FROM access_grants WHERE principal_id = ?", id
  29. Case "chunks"
  30. Set rs = DAL().Query("SELECT COUNT(*) FROM chunks WHERE document_id = ?", id)
  31. Response.Write rs(0) & vbCrLf
  32. rs.Close
  33. End Select
  34. Response.Write "ok" & vbCrLf
  35. %>

Powered by TurnKey Linux.