[Archivesspace_Users_Group] logged in admin users?
Steven Majewski
sdm7g at virginia.edu
Fri Jul 24 12:59:00 EDT 2015
It appears that just posting empty json to backend update_monitor gives me what I need.
( If not what I asked for! ;-)
curl_as_osx admin pwd -d ‘{}’ http://archivesspace:8089/update_monitor <http://archivesspace:8089/update_monitor> | jq .
gives me (I believe, if I’m understanding correctly) the items locked for editing
and the user editing:
{
"/repositories/5/archival_objects/5419": {
"edited_by": {
"ar4xd": "2015-07-24 16:50:31 UTC"
},
"lock_version": 6
},
"/repositories/5/archival_objects/5431": {
"edited_by": {
"ar4xd": "2015-07-24 16:50:47 UTC"
},
"lock_version": 6
}
}
I just want to check that no one is in the middle of an edit when I want to shut down and restart.
( Or know who to contact to ask them to finish up and logoff )
It seems to work to wait until update_monitor returns an empty JSON result.
— Steve.
> On Jul 13, 2015, at 5:48 PM, Chris Fitzpatrick <Chris.Fitzpatrick at lyrasis.org> wrote:
>
> Hi Steve,
>
> Trying to think off the top of my head for a solution...
>
> You could look at the session table in the database to see what sessions are still active.
>
> Or you could tail the log and see if the anything is hitting the /update_monitor with a post request. Like this:
> D, [2015-07-13T16:46:44.536000 #1057] DEBUG -- : Thread-6772: POST /update_monitor [session: #<Session:0x5f7c42bf @store={:user=>"staff_system", :login_time=>2015-07-13 16:44:14 -0500, :expirable=>false}, @id="ff50b6d8d6abe7694eed4866159c000dc84d67fd6f1016e538852d0bb8b4eb69">]
> D, [2015-07-13T16:46:44.540000 #1057] DEBUG -- : Thread-6772: Post-processed params: {:active_edits=>#<JSONModel(:active_edits) {"jsonmodel_type"=>"active_edits", "active_edits"=>[{"uri"=>"/repositories/2/resources/2", "user"=>"admin", "time"=>"2015-07-13T16:46:43-05:00"}]}>}
>
>
> That's a user's (in this case "admin") browser sending an AJAX request to check if anyone else if editing the record.
>
> If someone has a browser window open and their session is expired, you'll be seeing a 401 error there...
>
> b,chris.
>
> Chris Fitzpatrick | Developer, ArchivesSpace
> Skype: chrisfitzpat | Phone: 918.236.6048
> http://archivesspace.org/
>
> ________________________________________
> From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Steven Majewski <sdm7g at virginia.edu>
> Sent: Thursday, July 9, 2015 5:59 PM
> To: Archivesspace Users Group
> Subject: [Archivesspace_Users_Group] logged in admin users?
>
> Is there any way, other than scanning through the log files, to tell if users
> are currently logged into the frontend admin webapp ? The purpose being to
> check if it’s save to shutdown and restart the app without the chance of someone
> having unsaved edits.
>
>
>
> — Steve Majewski
>
> _______________________________________________
> Archivesspace_Users_Group mailing list
> Archivesspace_Users_Group at lyralists.lyrasis.org
> http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150724/28d2787d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4943 bytes
Desc: not available
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20150724/28d2787d/attachment.bin>
More information about the Archivesspace_Users_Group
mailing list