nice shot, but scheduler isn't supported in MEMDB.

On Wednesday, November 13, 2013 6:25:40 AM UTC+1, Joel Rathgaber wrote:
>
> Hey all, 
>
> I was attempting to set up a scheduler using a memcache backed MEMDB as 
> the store, but I keep getting this error.
>
> <type 'exceptions.TypeError'> int() argument must be a string or a number, 
> not 'MemcacheClientObj'
> Traceback:
>
> Traceback (most recent call last):
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/restricted.py", line 
> 217, in restricted
>     exec ccode in environment
>   File 
> "/usr/home/jrathgaber/bunnyhugdev/web2py/applications/test_memdb_scheduler/models/scheduler.py"
>  
> <http://127.0.0.1:8000/admin/default/edit/test_memdb_scheduler/models/scheduler.py>,
>  line 7, in <module>
>     scheduler = Scheduler(db)
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/scheduler.py", line 
> 458, in __init__
>     self.define_tables(db, migrate=migrate)
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/scheduler.py", line 
> 533, in define_tables
>     migrate=self.__get_migrate('scheduler_run', migrate)
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/contrib/memdb.py", line 
> 163, in define_table
>     t._create()
>   File "/usr/home/jrathgaber/bunnyhugdev/web2py/gluon/contrib/memdb.py", line 
> 230, in _create
>     self._db[referenced]._tableobj)
> TypeError: int() argument must be a string or a number, not 
> 'MemcacheClientObj'
>
> The line of code that seems to be causing the issue is this:
>
> ftype = \                                                       
>                      self._db._translator[field.type[:9]](                    
>    
>                          self._db[referenced]._tableobj)
>
> The field.type in question is a 'reference' which corresponds to a 
> _translator value of int.  
>
> _db[referenced] is 'scheduler_task' and is of type gluon.contrib.memdb.Table 
> and _tableobj is the MemcacheClient instance, as the error points out.
>
> What's going on here? Am I doing something wrong?
>
> I set up my scheduler like this
>
> import gluon.contrib.memcache 
> from gluon import current 
> from gluon.contrib.memdb import MEMDB 
> memcache_servers = ['127.0.0.1:11211'] 
> cache.memcache = gluon.contrib.memcache.MemcacheClient( 
> request,memcache_servers 
> ) 
> current.cache = cache db = MEMDB(cache.memcache)  
> from gluon.scheduler import Scheduler 
> scheduler = Scheduler(db) 
>
>
> Thanks in advance.
>
> Cheers,
>
> --Joel.
>
>
>
>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to