Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
06eb98ae
Commit
06eb98ae
authored
9 years ago
by
Nathaniel Kofalt
Browse files
Options
Downloads
Patches
Plain Diff
Remove hacks
parent
ae709542
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/api.py
+0
-1
0 additions, 1 deletion
api/api.py
api/core.py
+0
-48
0 additions, 48 deletions
api/core.py
with
0 additions
and
49 deletions
api/api.py
+
0
−
1
View file @
06eb98ae
...
...
@@ -58,7 +58,6 @@ routes = [
webapp2
.
Route
(
r
'
/reaper
'
,
core
.
Core
,
handler_method
=
'
reaper
'
,
methods
=
[
'
POST
'
]),
webapp2
.
Route
(
r
'
/sites
'
,
core
.
Core
,
handler_method
=
'
sites
'
,
methods
=
[
'
GET
'
]),
webapp2
.
Route
(
r
'
/config
'
,
core
.
Config
,
methods
=
[
'
GET
'
]),
webapp2
.
Route
(
r
'
/hack
'
,
core
.
Core
,
handler_method
=
'
hack
'
,
methods
=
[
'
GET
'
]),
webapp2
.
Route
(
r
'
/config.js
'
,
core
.
Config
,
handler_method
=
'
get_js
'
,
methods
=
[
'
GET
'
])
]),
webapp2
.
Route
(
r
'
/api/users
'
,
userhandler
.
UserHandler
,
handler_method
=
'
get_all
'
,
methods
=
[
'
GET
'
]),
...
...
This diff is collapsed.
Click to expand it.
api/core.py
+
0
−
48
View file @
06eb98ae
...
...
@@ -14,8 +14,6 @@ from . import base
from
.
import
files
from
.
import
util
from
.
import
config
from
.
import
jobs
from
.
import
rules
from
.dao
import
reaperutil
from
.
import
tempdir
as
tempfile
...
...
@@ -43,52 +41,6 @@ class Core(base.RequestHandler):
"""
Return 200 OK.
"""
pass
def
hack
(
self
):
for
c_type
in
[
'
projects
'
,
'
collections
'
,
'
sessions
'
,
'
acquisitions
'
]:
# This projection needs every field required to know what type of container it is & navigate to its project
containers
=
config
.
db
[
c_type
].
find
({
'
files.unprocessed
'
:
True
},
[
'
files
'
,
'
session
'
,
'
project
'
])
for
c
in
containers
:
for
f
in
c
[
'
files
'
]:
if
f
.
get
(
'
unprocessed
'
):
rules
.
create_jobs
(
config
.
db
,
c
,
c_type
,
f
)
r
=
config
.
db
[
c_type
].
update_one
(
{
'
_id
'
:
c
[
'
_id
'
],
'
files
'
:
{
'
$elemMatch
'
:
{
'
name
'
:
f
[
'
name
'
],
'
hash
'
:
f
[
'
hash
'
],
},
},
},
{
'
$set
'
:
{
'
files.$.unprocessed
'
:
False
,
},
},
)
if
not
r
.
matched_count
:
log
.
info
(
'
file modified or removed, not marked as clean: %s %s, %s
'
%
(
c_type
,
c
,
f
[
'
name
'
]))
while
True
:
j
=
config
.
db
.
jobs
.
find_one_and_update
(
{
'
state
'
:
'
running
'
,
'
modified
'
:
{
'
$lt
'
:
datetime
.
datetime
.
utcnow
()
-
datetime
.
timedelta
(
seconds
=
100
)},
},
{
'
$set
'
:
{
'
state
'
:
'
failed
'
,
},
},
)
if
j
is
None
:
break
else
:
jobs
.
retry_job
(
config
.
db
,
j
)
def
get
(
self
):
"""
Return API documentation
"""
resources
=
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment