Not that it helps much, but that is some pretty awful code. The locks
are too much and the code generating cfid seems quite wack.

On Tue, 17 Aug 2004 15:39:58 -0500, Ryan Duckworth <[EMAIL PROTECTED]> wrote:
>  <cfloop collection="#Application.UsersInfo#" item="itmUser">
>       <cfset userActiveTime = Evaluate(DateDiff("n",
> StructFind(Application.UsersInfo, itmUser), Now()))>
>
>       #userActiveTime#
>
>  </cfloop>
>
> Ryan Duckworth
> Macromedia ColdFusion Certified Professional
> Uhlig Communications
> 10983 Granada Lane
> Overland Park, KS 66211
> (913) 754-4272
>
>   _____
>
> From: Sung Woo [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 17, 2004 3:18 PM
> To: CF-Talk
> Subject: Count Online Users Conundrum
>
>
> I got this little snippet from easycfm.com to keep track of online
> users, but lately, it hasn't been working quite right.  What happens is
> that at the end of the day (I run an intranet where there are about 200
> peak users), around midnight, it still shows 80 or so users online!
> What do you think could be causing this?
>
> <!--- http://tutorial12.easycfm.com/ - show session users - BEGIN --->
>
> <cflock timeout="15" scope="APPLICATION" type="EXCLUSIVE">
>     <cfif NOT isDefined("Application.UsersInfo")>
>           <cfset Application.UsersInfo = StructNew()>
>     </cfif>
> </cflock>
>
> <cflock name="#CreateUUID()#" timeout="15" type="EXCLUSIVE">
>       <cfset user_cfid = Evaluate(CFID)>
>       <cfset user_time = Now()>
> </cflock>
>
> <cflock scope="APPLICATION" type="EXCLUSIVE" timeout="15">
> <cfif NOT StructKeyExists(Application.UsersInfo, user_cfid)>
>   <cfset temp = StructInsert(Application.UsersInfo, user_cfid,
> user_time)>
> </cfif>
> </cflock>
>
> <cflock scope="APPLICATION" type="EXCLUSIVE" timeout="15">
> <cfloop collection="#Application.UsersInfo#" item="itmUser">
>   <cfif
>    Evaluate(DateDiff("n", StructFind(Application.UsersInfo, itmUser),
> Now())) GT 15
>   >
>     <cfset StructDelete(Application.UsersInfo, itmUser)>
>   </cfif>
> </cfloop>
> </cflock>
>
> <!--- http://tutorial12.easycfm.com/ - show session users - END --->
>
> -----
>
> <!--- http://tutorial12.easycfm.com/ - show session users --->
>
> <cflock scope="APPLICATION" type="EXCLUSIVE" timeout="10">
>     <cfoutput>
>          Total Active Sessions : #StructCount(Application.UsersInfo)#
>     </cfoutput>
> </cflock>
>
>   _____
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to